Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auto-timesheet

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-timesheet - npm Package Compare versions

Comparing version 0.0.36 to 0.0.37

src/config/conf-template-generator.js

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc