clubhouse-cli
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "clubhouse-cli", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "A command line tool for viewing, creating and updating clubhouse.io stories", | ||
@@ -32,3 +32,3 @@ "main": "index.js", | ||
"cli-spinner": "^0.2.6", | ||
"clubhouse-lib": "^0.2.0", | ||
"clubhouse-lib": "^0.3.0", | ||
"commander": "^2.11.0", | ||
@@ -35,0 +35,0 @@ "debug": "^3.1.0", |
@@ -282,2 +282,7 @@ # clubhouse-cli | ||
You may also provide a clubhouse API token via environment variable `CLUBHOUSE_API_TOKEN`. | ||
~~~sh | ||
$ CLUBHOUSE_API_TOKEN=foobar club story 3300 | ||
~~~ | ||
## Acknowledgments | ||
@@ -284,0 +289,0 @@ |
@@ -8,5 +8,10 @@ const path = require('path'); | ||
const loadConfig = () => { | ||
const envToken = process.env.CLUBHOUSE_API_TOKEN; | ||
if (fs.existsSync(configFile)) { | ||
try { | ||
return JSON.parse(fs.readFileSync(configFile, 'utf8')); | ||
const config = JSON.parse(fs.readFileSync(configFile, 'utf8')); | ||
if (envToken) { | ||
return Object.assign({}, config, { token: envToken }); | ||
} | ||
return config; | ||
} catch (e) { | ||
@@ -17,2 +22,5 @@ console.error(e); | ||
} | ||
if (envToken) { | ||
return { token: envToken }; | ||
} | ||
return false; | ||
@@ -19,0 +27,0 @@ }; |
const chalk = require('chalk'); | ||
const debug = require('debug')('club'); | ||
const client = require('./client.js'); | ||
@@ -11,2 +12,3 @@ const log = console.log; | ||
const listStories = async (program) => { | ||
debug('request workflows, members, projects, epics'); | ||
[ wfs, members, projects, epics ] = await Promise.all([ | ||
@@ -18,2 +20,3 @@ client.listWorkflows(), | ||
]); | ||
debug('response workflows, members, projects, epics'); | ||
wf = wfs[0]; // TODO: this is always getting the default workflow | ||
@@ -25,3 +28,5 @@ let regexProject = new RegExp(program.project, 'i'); | ||
}); | ||
debug('filtering projects'); | ||
var stories = await Promise.all(filteredProjects.map(fetchStories)); | ||
debug('filtering stories'); | ||
return stories.map(filterStories(program, filteredProjects)) | ||
@@ -34,2 +39,3 @@ .reduce((a, b) => { | ||
const fetchStories = async (project) => { | ||
debug('request stories for project', project.id); | ||
return client.listStories(project.id); | ||
@@ -112,2 +118,3 @@ }; | ||
}; | ||
debug('sorting stories'); | ||
return (a, b) => { | ||
@@ -114,0 +121,0 @@ return fields.reduce((acc, field) => { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
52281
288
293
2
+ Addedclubhouse-lib@0.3.1(transitive)
- Removedclubhouse-lib@0.2.1(transitive)
Updatedclubhouse-lib@^0.3.0