auto-timesheet
Advanced tools
Comparing version 0.0.36 to 0.0.37
{ | ||
"name": "auto-timesheet", | ||
"version": "0.0.36", | ||
"version": "0.0.37", | ||
"description": "Add redmine timesheet automatically and periodically.", | ||
@@ -40,2 +40,3 @@ "main": "./src/bin/auto-timesheet.js", | ||
"fast-levenshtein": "^2.0.6", | ||
"jsonfile": "^3.0.1", | ||
"lme": "^1.5.3", | ||
@@ -45,3 +46,4 @@ "lru-cache": "^4.1.1", | ||
"serialize-error": "^2.1.0", | ||
"update-available": "^1.0.1" | ||
"update-available": "^1.0.1", | ||
"user-home": "^2.0.0" | ||
}, | ||
@@ -48,0 +50,0 @@ "contributors": [ |
#!/usr/bin/env node | ||
const path = require('path'); | ||
const editor = require('editor'); | ||
const path = require('path'); | ||
const confGen = require('../config/conf-template-generator'); | ||
const home = require('user-home'); | ||
editor('credentials/config.json', function(code) { | ||
if (code !== 0) throw new Error('something went wrong while saving configuration'); | ||
const configFile = path.join(home, '/.auto-timesheet.config.json'); | ||
console.log('done!'); | ||
console.log('------------------------------------------------'); | ||
console.log('run `auto-timesheet set-cred` to set credentials'); | ||
console.log('run `auto-timesheet start` to start the app'); | ||
console.log('------------------------------------------------enjoy'); | ||
}); | ||
try { | ||
// check if the conf exists or not | ||
require(configFile); | ||
console.log('config file found: opening editor..'); | ||
openEditor(); | ||
} catch (err) { | ||
if (err instanceof SyntaxError) { | ||
console.log('syntax err found in the config file > regenerating ...'); | ||
} | ||
// make the file with initial values | ||
else { | ||
console.log('Initializing credentials ...'); | ||
} | ||
confGen(configFile, openEditor); | ||
} | ||
function openEditor() { | ||
console.log('opening editor'); | ||
return editor(configFile, function(code) { | ||
if (code !== 0) throw new Error('something went wrong while saving configuration'); | ||
console.log('You\'ve edited config successfully!'); | ||
console.log('------------------------------------------------'); | ||
console.log('run `auto-timesheet start` to start the app'); | ||
console.log('------------------------------------------------enjoy'); | ||
}); | ||
} |
@@ -8,5 +8,4 @@ #!/usr/bin/env node | ||
.version(version) | ||
.command('cred', 'set credentials') | ||
.command('conf', 'configure stuff') | ||
.command('start', 'start application') | ||
.parse(process.argv); |
Sorry, the diff of this file is not supported yet
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
103011
16
629
+ Addedjsonfile@^3.0.1
+ Addeduser-home@^2.0.0
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedjsonfile@3.0.1(transitive)
+ Addedos-homedir@1.0.2(transitive)
+ Addeduser-home@2.0.0(transitive)