add more spells
- [x] accio for wget
- [ ] add more here
What if wget isn't installed
@yamboy1
exec(command,function(err,stdout,stderr){
if(err){
return console.log(chalk.greenBright('FileError: Some error occured while fetching URL'));
}
return console.log(chalk.yellowBright('File Download successful'));
});
Here, if err occurs, then you can install wget, simple code will be:
exec(command,function(err,stdout,stderr){
if(err){
console.log(err);
exec("sudo apt-get install wget",(error,stdout,stderr){
if(error){console.log(error)}
else{console.log('wget installed successfully');
});
}
else{
return console.log(chalk.yellowBright('File Download successful'));
}
});
But since there can be many errors like error with URL parsing and wget not installed error. so if you have a better code that can differentiate between between these errors then by all means do it and send a pr.
Cheers!
I'll look into this.
BTW: There is more than one package manager. Debian and Ubuntu use apt, but other distros use rpm, pacman (Yes that is actually a package manager), yum and many more so you would have to account for those.
@gabru-md Could you assign this issue to me.
Issues can only be assingned to collaborators i guess. You can send a Pull Request with the changes done. If you want to collabirate then please verify your emwil address registered with github and let me know.
Cheers!
I'm going to add an npm preinstall hook rather than add the code into accio.js
sure :+1:
Heres my pull request #4. It still needs some testing.
@gabru-md can you suggest any spell which I can work upon and add it.
@ms10398 have you seen/read harry potter ? If yes then you can add any spell with a relevant linux command attached to it. I donot have any in mind as of now. Do you have any ?
Yes I have seen Harry Potter :smile: !! I will see all harry potter spells and check if can get a good spell in mind to add it.
added a spell - nox PR - https://github.com/yogdaan/LinuxSpells/pull/15