mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 16:26:25 +00:00
disable colors in ci mode
This commit is contained in:
parent
f6860115a3
commit
878a7bd752
@ -1,3 +1,3 @@
|
|||||||
## 0.24
|
## 0.25
|
||||||
|
|
||||||
- Exit code on failure
|
- disable color in CI mode
|
||||||
|
11
src/index.ts
11
src/index.ts
@ -1,4 +1,4 @@
|
|||||||
import 'colors'
|
import colors from 'colors'
|
||||||
import { program } from 'commander'
|
import { program } from 'commander'
|
||||||
import { setCIMode } from 'clitastic'
|
import { setCIMode } from 'clitastic'
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ import install from './handlers/install'
|
|||||||
import { uninstall } from './handlers/uninstall'
|
import { uninstall } from './handlers/uninstall'
|
||||||
import { upgrade } from './handlers/upgrade'
|
import { upgrade } from './handlers/upgrade'
|
||||||
|
|
||||||
export const VERSION = '0.24'
|
export const VERSION = '0.25'
|
||||||
export const INSTALL_DIR = '/usr/local/bin'
|
export const INSTALL_DIR = '/usr/local/bin'
|
||||||
|
|
||||||
let requireConfig: boolean = true
|
let requireConfig: boolean = true
|
||||||
@ -111,7 +111,9 @@ const { verbose, config: configFile, ci } = program.parse(process.argv)
|
|||||||
export const VERBOSE = verbose
|
export const VERBOSE = verbose
|
||||||
export let config: Config
|
export let config: Config
|
||||||
setCIMode(ci)
|
setCIMode(ci)
|
||||||
;(async () => {
|
if (ci) colors.disable()
|
||||||
|
|
||||||
|
async function main() {
|
||||||
try {
|
try {
|
||||||
const lock = readLock()
|
const lock = readLock()
|
||||||
if (lock.running) throw new Error('An instance of autorestic is already running for this config file'.red)
|
if (lock.running) throw new Error('An instance of autorestic is already running for this config file'.red)
|
||||||
@ -129,4 +131,5 @@ setCIMode(ci)
|
|||||||
} finally {
|
} finally {
|
||||||
unlock()
|
unlock()
|
||||||
}
|
}
|
||||||
})()
|
}
|
||||||
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user