make script errors fatal

This commit is contained in:
Eugene Pankov 2022-01-16 19:41:01 +01:00
parent 782128308c
commit 64410a9302
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4
6 changed files with 29 additions and 34 deletions

View File

@ -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 })
})

View File

@ -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 })
})

View File

@ -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)

View File

@ -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('..')
})

View File

@ -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'), '{}')

View File

@ -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('..')
})