1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Tools: Fixed build

This commit is contained in:
Laurent Cozic
2021-09-04 15:15:25 +01:00
parent 736bbbd8ed
commit f5891dfae8
9 changed files with 18 additions and 10 deletions

View File

@ -11,7 +11,7 @@ import * as stopExternalEditing from './stopExternalEditing';
import * as toggleExternalEditing from './toggleExternalEditing';
import * as toggleSafeMode from './toggleSafeMode';
const index: any[] = [
const index:any[] = [
copyDevCommand,
exportFolders,
exportNotes,

View File

@ -30,7 +30,7 @@ import * as toggleNoteList from './toggleNoteList';
import * as toggleSideBar from './toggleSideBar';
import * as toggleVisiblePanes from './toggleVisiblePanes';
const index: any[] = [
const index:any[] = [
commandPalette,
editAlarm,
exportPdf,

View File

@ -4,7 +4,7 @@ import * as focusElementNoteTitle from './focusElementNoteTitle';
import * as showLocalSearch from './showLocalSearch';
import * as showRevisions from './showRevisions';
const index: any[] = [
const index:any[] = [
focusElementNoteBody,
focusElementNoteTitle,
showLocalSearch,

View File

@ -1,7 +1,7 @@
// AUTO-GENERATED using `gulp buildCommandIndex`
import * as focusElementNoteList from './focusElementNoteList';
const index: any[] = [
const index:any[] = [
focusElementNoteList,
];

View File

@ -1,7 +1,7 @@
// AUTO-GENERATED using `gulp buildCommandIndex`
import * as focusSearch from './focusSearch';
const index: any[] = [
const index:any[] = [
focusSearch,
];

View File

@ -1,7 +1,7 @@
// AUTO-GENERATED using `gulp buildCommandIndex`
import * as focusElementSideBar from './focusElementSideBar';
const index: any[] = [
const index:any[] = [
focusElementSideBar,
];

View File

@ -3,7 +3,7 @@ import * as historyBackward from './historyBackward';
import * as historyForward from './historyForward';
import * as synchronize from './synchronize';
const index: any[] = [
const index:any[] = [
historyBackward,
historyForward,
synchronize,

View File

@ -1,7 +1,6 @@
const utils = require('../utils');
const glob = require('glob');
const rootDir = utils.rootDir();
const pathUtils = require('@joplin/lib/path-utils');
async function processDirectory(dir) {
const tsFiles = glob.sync('{**/*.ts,**/*.tsx}', {
@ -11,7 +10,7 @@ async function processDirectory(dir) {
const fileContent = [];
for (const tsFile of tsFiles) {
const f = pathUtils.filename(tsFile);
const f = utils.getFilename(tsFile);
fileContent.push(`import * as ${f} from './${f}';`);
}
@ -20,7 +19,7 @@ async function processDirectory(dir) {
fileContent.push('const index:any[] = [');
for (const tsFile of tsFiles) {
const f = pathUtils.filename(tsFile);
const f = utils.getFilename(tsFile);
fileContent.push(`\t${f},`);
}

View File

@ -182,4 +182,13 @@ utils.insertContentIntoFile = async (filePath, marker, contentToInsert, createIf
}
};
utils.getFilename = (path) => {
const lastPart = path.split('/').pop();
if (lastPart.indexOf('.') < 0) return lastPart;
const splitted = lastPart.split('.');
splitted.pop();
return splitted.join('.');
};
module.exports = utils;