diff --git a/scripts/build-docs.js b/scripts/build-docs.js index 933cf2e4..4d5519d6 100755 --- a/scripts/build-docs.js +++ b/scripts/build-docs.js @@ -5,5 +5,5 @@ const log = require('npmlog') vars.packagesWithDocs.forEach(([dest, src]) => { log.info('docs', src) - sh.exec(`yarn typedoc --out docs/api/${dest} --tsconfig ${src}/tsconfig.typings.json ${src}/src/index.ts`) + sh.exec(`yarn typedoc --out docs/api/${dest} --tsconfig ${src}/tsconfig.typings.json ${src}/src/index.ts`, { fatal: true }) }) diff --git a/scripts/build-typings.js b/scripts/build-typings.js index ad07db9f..7a28a550 100755 --- a/scripts/build-typings.js +++ b/scripts/build-typings.js @@ -5,5 +5,5 @@ const log = require('npmlog') vars.builtinPlugins.forEach(plugin => { log.info('typings', plugin) - sh.exec(`npx tsc --project ${plugin}/tsconfig.typings.json`) + sh.exec(`yarn tsc --project ${plugin}/tsconfig.typings.json`, { fatal: true }) }) diff --git a/scripts/i18n-extract.js b/scripts/i18n-extract.js index 4f032ca3..d372d2e9 100755 --- a/scripts/i18n-extract.js +++ b/scripts/i18n-extract.js @@ -13,15 +13,14 @@ const tempHtml = 'locale/tmp-html' for (const plugin of vars.builtinPlugins) { log.info('extract-pug', plugin) - sh.exec(`yarn pug --doctype html -s --pretty -O '{require: function(){}}' -o ${tempHtml}/${plugin} ${plugin}`) + sh.exec(`yarn pug --doctype html -s --pretty -O '{require: function(){}}' -o ${tempHtml}/${plugin} ${plugin}`, { fatal: true }) log.info('extract-ts', plugin) - sh.exec(`node node_modules/.bin/ngx-translate-extract -i ${plugin}/src -m -s -f pot -o ${tempOutput}`) - + sh.exec(`node node_modules/.bin/ngx-translate-extract -i ${plugin}/src -m -s -f pot -o ${tempOutput}`, { fatal: true }) } log.info('extract-pug') - sh.exec(`node node_modules/.bin/ngx-translate-extract -i ${tempHtml} -f pot -s -o ${tempOutput}`) + sh.exec(`node node_modules/.bin/ngx-translate-extract -i ${tempHtml} -f pot -s -o ${tempOutput}`, { fatal: true }) sh.rm('-r', tempHtml) await fs.rename(tempOutput, pot) diff --git a/scripts/install-deps.js b/scripts/install-deps.js index 52b05549..0974d31d 100755 --- a/scripts/install-deps.js +++ b/scripts/install-deps.js @@ -1,30 +1,26 @@ #!/usr/bin/env node const sh = require('shelljs') -const path = require('path') const vars = require('./vars') const log = require('npmlog') -const localBinPath = path.resolve(__dirname, '../node_modules/.bin') -const npx = `${localBinPath}/npx` - log.info('patch') -sh.exec(`${npx} patch-package`) +sh.exec(`yarn patch-package`, { fatal: true }) log.info('deps', 'app') sh.cd('app') -sh.exec(`${npx} yarn install --force`) +sh.exec(`yarn yarn install --force`, { fatal: true }) sh.cd('..') sh.cd('web') -sh.exec(`${npx} yarn install --force`) -sh.exec(`${npx} patch-package`) +sh.exec(`yarn yarn install --force`, { fatal: true }) +sh.exec(`yarn patch-package`, { fatal: true }) sh.cd('..') vars.allPackages.forEach(plugin => { log.info('deps', plugin) sh.cd(plugin) - sh.exec(`${npx} yarn install --force`) + sh.exec(`yarn install --force`, { fatal: true }) sh.cd('..') }) diff --git a/scripts/prepackage-plugins.js b/scripts/prepackage-plugins.js index ce5f4769..7696faae 100755 --- a/scripts/prepackage-plugins.js +++ b/scripts/prepackage-plugins.js @@ -11,25 +11,25 @@ sh.mkdir('-p', target) fs.writeFileSync(path.join(target, 'package.json'), '{}') sh.cd(target) vars.builtinPlugins.forEach(plugin => { - if (plugin === 'tabby-web') { - return - } - log.info('install', plugin) - sh.cp('-r', path.join('..', plugin), '.') - sh.rm('-rf', path.join(plugin, 'node_modules')) - sh.cd(plugin) - sh.exec(`yarn install --force --production`) + if (plugin === 'tabby-web') { + return + } + log.info('install', plugin) + sh.cp('-r', path.join('..', plugin), '.') + sh.rm('-rf', path.join(plugin, 'node_modules')) + sh.cd(plugin) + sh.exec(`yarn install --force --production`, { fatal: true }) - log.info('rebuild', 'native') - if (fs.existsSync('node_modules')) { - rebuild({ - buildPath: path.resolve('.'), - electronVersion: vars.electronVersion, - arch: process.env.ARCH ?? process.arch, - force: true, - }) - } - sh.cd('..') + log.info('rebuild', 'native') + if (fs.existsSync('node_modules')) { + rebuild({ + buildPath: path.resolve('.'), + electronVersion: vars.electronVersion, + arch: process.env.ARCH ?? process.arch, + force: true, + }) + } + sh.cd('..') }) fs.unlinkSync(path.join(target, 'package.json'), '{}') diff --git a/scripts/publish-plugins.js b/scripts/publish-plugins.js index d5d7b31e..b020306a 100755 --- a/scripts/publish-plugins.js +++ b/scripts/publish-plugins.js @@ -7,7 +7,7 @@ const { execSync } = require('child_process') vars.allPackages.forEach(plugin => { log.info('bump', plugin) sh.cd(plugin) - sh.exec('npm --no-git-tag-version version ' + vars.version) + sh.exec('npm --no-git-tag-version version ' + vars.version, { fatal: true }) execSync('npm publish', { stdio: 'inherit' }) sh.cd('..') })