Last active
May 21, 2020 10:41
-
-
Save goldzulu/3e41a864de6fd5e2b9a9fb3b7cf9bacc to your computer and use it in GitHub Desktop.
Scripts to help update the latest ask-cli, change it to be called askx and then install the package (locally) for those of you using method 2 https://gist.github.com/germanviscuso/48f5c68f876b31b51ba59f91b49a253f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const fileName = './package.json'; | |
let file = require(fileName); | |
console.log(file.name); | |
if (file.name == "ask-cli") { | |
file.name="ask-cli-x"; | |
console.log("Changed name ask-cli to name ask-cli-x"); | |
} | |
if (file.bin.ask) { | |
delete file.bin.ask; | |
file.bin = { | |
"askx": "bin/ask.js" | |
} | |
console.log("Changed bin from ask to askx"); | |
} | |
fs.writeFile(fileName, JSON.stringify(file, null, 4), function writeJSON(err) { | |
if (err) return console.log(err); | |
console.log(JSON.stringify(file,null,4)); | |
console.log('Updating ' + fileName + ' successful'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#comment out below if you don't want to remove the package.json.. e.g. you might want to use git stash instead | |
git fetch --all | |
git reset --hard origin/master | |
node ./changeAskToAskX.js | |
npm install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment