Skip to content

Commit

Permalink
Add gitignore and remove package lock on pluginhelper
Browse files Browse the repository at this point in the history
  • Loading branch information
volumio committed Jun 25, 2018
1 parent e4d8c1f commit 99d5a51
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pluginhelper.js
Expand Up @@ -2,7 +2,8 @@ var fs = require('fs-extra');
var exec = require('child_process').exec;
var execSync = require('child_process').execSync;
var inquirer = require('inquirer');
var websocket = require('socket.io-client')
var websocket = require('socket.io-client');
var os = require('os');

// ============================== CREATE PLUGIN ===============================

Expand Down Expand Up @@ -317,7 +318,9 @@ function finalizing(path, package) {
package.name);

console.log("Installing dependencies locally");
execSync("/bin/rm package-lock.json");
execSync("/usr/local/bin/npm install");
execSync("/bin/rm package-lock.json");

console.log("\nCongratulation, your plugin has been succesfully created!\n" +
"You can find it in: " + path + "\n");
Expand Down Expand Up @@ -352,7 +355,9 @@ function zip(){
if(! fs.existsSync("node_modules")) {
console.log("No modules found, running \"npm install\"");
try{
execSync("/bin/rm package-lock.json");
execSync("/usr/local/bin/npm install");
execSync("/bin/rm package-lock.json");
}
catch (e){
console.log("Error installing node modules: " + e);
Expand Down Expand Up @@ -408,9 +413,9 @@ function publish() {
inquirer.prompt(questions).then(function (answer) {
package.version = answer.version;
fs.writeJsonSync("package.json", package, {spaces:'\t'});
fs.writeFileSync(".gitignore", ".gitignore" + os.EOL + "node_modules" + os.EOL + "*.zip");
try {
execSync("/usr/bin/git add *");

}
catch (e){
console.log("Nothing to add");
Expand Down

0 comments on commit 99d5a51

Please sign in to comment.