mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(cloudcmd) --config-path
This commit is contained in:
parent
9259792bc9
commit
7e9ae801b9
2 changed files with 9 additions and 1 deletions
|
|
@ -38,6 +38,7 @@ const args = require('minimist')(argv.slice(2), {
|
|||
'import-url',
|
||||
'import-token',
|
||||
'export-token',
|
||||
'config-path',
|
||||
],
|
||||
boolean: [
|
||||
'auth',
|
||||
|
|
@ -92,6 +93,7 @@ const args = require('minimist')(argv.slice(2), {
|
|||
|
||||
'sync-console-path': choose(env.bool('sync_console_path'), config('syncConsolePath')),
|
||||
'config-dialog': choose(env.bool('config_dialog'), config('configDialog')),
|
||||
'config-path': env('config_path') || config('configPath'),
|
||||
'terminal-path': env('terminal_path') || config('terminalPath'),
|
||||
'one-file-panel': choose(env.bool('one_file_panel'), config('oneFilePanel')),
|
||||
'confirm-copy': choose(env.bool('confirm_copy'), config('confirmCopy')),
|
||||
|
|
@ -150,6 +152,7 @@ function main() {
|
|||
config('confirmMove', args['confirm-move']);
|
||||
config('oneFilePanel', args['one-file-panel']);
|
||||
config('configDialog', args['config-dialog']);
|
||||
config('configPath', args['config-path']);
|
||||
config('keysPanel', args['keys-panel']);
|
||||
config('export', args.export);
|
||||
config('exportToken', args['export-token']);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,12 @@ const jju = require('jju');
|
|||
const writejson = require('writejson');
|
||||
const tryCatch = require('try-catch');
|
||||
const criton = require('criton');
|
||||
const HOME = require('os').homedir();
|
||||
|
||||
const homeDir = require('os').homedir();
|
||||
const configPath = config('configPath')
|
||||
.replace(/^~/, homeDir);
|
||||
|
||||
const HOME = configPath || homeDir;
|
||||
|
||||
const manageConfig = squad(traverse, cryptoPass);
|
||||
const save = promisify(_save);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue