Skip to content

Commit

Permalink
Added edit command
Browse files Browse the repository at this point in the history
  • Loading branch information
hemanth-hk committed Mar 31, 2020
1 parent 189ad84 commit 71298b5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions commands/edit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// modules
const path = require("path");
const exec = require("child_process").exec;

// imports
var filePath = path.join(__dirname, "..");
var sxconfig = require(path.join(__dirname, "..", "sxconfig.json"));


function edit() {
exec(`cd ${filePath} && ${sxconfig.Text_editor[1]['command']} sxconfig.json`, error => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`Opening Config file...`);
});
}

module.exports = edit;

0 comments on commit 71298b5

Please sign in to comment.