gitlab-cli
Advanced tools
Comparing version 0.0.17 to 0.1.0
#!/usr/bin/env node | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var home = require('home'); | ||
var optimist = require('optimist'); | ||
@@ -7,3 +10,2 @@ var gitlab = require('node-gitlab'); | ||
var stringify = require('../lib/stringify'); | ||
var defaults = require('../lib/defaults'); | ||
var optionsParser = require('../lib/parser/optionsParser'); | ||
@@ -14,3 +16,2 @@ var dataParser = require('../lib/parser/dataParser'); | ||
var argv = optimist.argv; | ||
var fs = require('fs'); | ||
@@ -22,2 +23,7 @@ var deps = {}; // dependencies passed around | ||
if (argv.env) { | ||
console.log('The --env option is not used anymore. Please use --config instead.'); | ||
process.exit(1); | ||
} | ||
// help wanted or missing arguments, exit | ||
@@ -30,5 +36,15 @@ if (argv['h'] || argv['help'] || argv._.length < 1) { | ||
// load environment | ||
var env = argv.env || 'default'; | ||
var config = require('../config/' + env); | ||
var configPath = (typeof argv.config === 'string') ? argv.config : '~/.config/gitlab-cli/default.js'; | ||
try { | ||
var configFullPath = home.resolve(configPath); | ||
} catch(error) { | ||
} | ||
if (!configFullPath || !fs.existsSync(configFullPath)) { | ||
console.log('Configuration file could not be found under: ' + configPath + '\nPlease create it from the example under config/default.sample.js'); | ||
process.exit(1); | ||
} | ||
var config = require(configFullPath); | ||
// aliases file might not exist | ||
@@ -35,0 +51,0 @@ try { |
@@ -47,4 +47,11 @@ var defaults = require('../defaults'); | ||
if (argv['config']) { | ||
options.config = argv['config']; | ||
} | ||
else { | ||
options.config = '~/.config/gitlab-cli/default.js' | ||
} | ||
return options; | ||
} | ||
module.exports = parse; |
{ | ||
"name": "gitlab-cli", | ||
"version": "0.0.17", | ||
"version": "0.1.0", | ||
"description": "Gitlab API on the command line", | ||
@@ -23,5 +23,10 @@ "main": "./bin/cli.js", | ||
}, | ||
"keywords": ["gitlab", "cli", "command line"], | ||
"keywords": [ | ||
"gitlab", | ||
"cli", | ||
"command line" | ||
], | ||
"readmeFilename": "README.md", | ||
"dependencies": { | ||
"home": "^0.1.3", | ||
"node-gitlab": ">=0.0.6", | ||
@@ -28,0 +33,0 @@ "optimist": ">=0.6.0" |
@@ -30,6 +30,6 @@ Usage: gitlab Action [Resource] [Options] | ||
--json Output all data as JSON | ||
--env ENVIRONMENT Environment to use under /config/. If not set will use the 'default' environment. | ||
--data key=value,... Set data by comma separated list of key=value pairs. | ||
--data-json JSON Set data using a JSON string. If "data" is also set, it will overwrite existing keys. | ||
--accept-certs If present all SSL certificates (including self-signed) will be accepted | ||
--config=path/to/config.js Set path to configuration file to use. If not set it will look for the file in ~/.config/gitlab-cli/default.js | ||
--debug If present will display debug information |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
23987
798
3
+ Addedhome@^0.1.3
+ Addedhome@0.1.8(transitive)