Skip to content

Commit

Permalink
don't require config for update
Browse files Browse the repository at this point in the history
  • Loading branch information
cupcakearmy committed Nov 13, 2020
1 parent cfcc010 commit d4b8a72
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import install from './handlers/install'
import { uninstall } from './handlers/uninstall'
import { upgrade } from './handlers/upgrade'

export const VERSION = '0.22'
export const VERSION = '0.23'
export const INSTALL_DIR = '/usr/local/bin'
let requireConfig: boolean = true

process.on('uncaughtException', (err) => {
console.log(err.message)
Expand Down Expand Up @@ -90,12 +91,19 @@ program.command('install').description('Installs both restic and autorestic to /

program.command('uninstall').description('Uninstalls autorestic from the system').action(enqueue(uninstall))

program.command('upgrade').alias('update').description('Checks and installs new autorestic versions').action(enqueue(upgrade))
program
.command('upgrade')
.alias('update')
.description('Checks and installs new autorestic versions')
.action(() => {
requireConfig = false
queue = upgrade
})

const { verbose, config: configFile, ci } = program.parse(process.argv)

export const VERBOSE = verbose
export let config: Config = init(configFile)
export let config: Config
setCIMode(ci)

try {
Expand All @@ -106,6 +114,8 @@ try {
...lock,
running: true,
})

if (requireConfig) config = init(configFile)

This comment has been minimized.

Copy link
@sumnerboy12

sumnerboy12 Nov 28, 2020

Contributor

See #34

queue()
} catch (e) {
console.error(e.message)
Expand Down

1 comment on commit d4b8a72

@vercel
Copy link

@vercel vercel bot commented on d4b8a72 Nov 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.