fix environment detection
This commit is contained in:
25
ts/index.ts
25
ts/index.ts
@ -27,6 +27,7 @@ smartcli.addCommand('build')
|
||||
.then(NpmciEnv.configStore)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
|
||||
@ -35,6 +36,10 @@ smartcli.addCommand('clean')
|
||||
.then((argv) => {
|
||||
clean()
|
||||
.then(NpmciEnv.configStore)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
|
||||
// command
|
||||
@ -42,6 +47,10 @@ smartcli.addCommand('command')
|
||||
.then((argv) => {
|
||||
command()
|
||||
.then(NpmciEnv.configStore)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
|
||||
// install
|
||||
@ -49,6 +58,10 @@ smartcli.addCommand('install')
|
||||
.then((argv) => {
|
||||
install(argv._[ 1 ])
|
||||
.then(NpmciEnv.configStore)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
|
||||
// prepare
|
||||
@ -56,6 +69,10 @@ smartcli.addCommand('prepare')
|
||||
.then((argv) => {
|
||||
prepare(argv._[ 1 ])
|
||||
.then(NpmciEnv.configStore)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
|
||||
// publish
|
||||
@ -63,6 +80,10 @@ smartcli.addCommand('publish')
|
||||
.then((argv) => {
|
||||
publish(argv._[ 1 ])
|
||||
.then(NpmciEnv.configStore)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
|
||||
// test
|
||||
@ -70,6 +91,10 @@ smartcli.addCommand('test')
|
||||
.then((argv) => {
|
||||
test(argv._[ 1 ])
|
||||
.then(NpmciEnv.configStore)
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
|
||||
// trigger
|
||||
|
@ -4,7 +4,7 @@ import { GitRepo } from 'smartstring'
|
||||
import { Dockerfile } from './npmci.build.docker'
|
||||
|
||||
export let repo: GitRepo
|
||||
if (process.env.CI_BUILD_REPO) repo = new GitRepo(process.env.CI_BUILD_REPO)
|
||||
if (process.env.CI_REPOSITORY_URL) repo = new GitRepo(process.env.CI_REPOSITORY_URL)
|
||||
|
||||
export let buildStage: string = process.env.CI_BUILD_STAGE
|
||||
|
||||
@ -44,9 +44,8 @@ let configLoad = () => {
|
||||
if (!config.project) {
|
||||
config.project = plugins.smartfile.fs.toObjectSync(paths.NpmciProjectDir, 'npmci.json')
|
||||
plugins.beautylog.ok('project config found!')
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
} catch (err) {
|
||||
config.project = {}
|
||||
plugins.beautylog.log('no project config found, so proceeding with default behaviour!')
|
||||
}
|
||||
|
Reference in New Issue
Block a user