LinuxSpells icon indicating copy to clipboard operation
LinuxSpells copied to clipboard

add more spells

Open gabru-md opened this issue 8 years ago • 12 comments

  • [x] accio for wget
  • [ ] add more here

gabru-md avatar Jul 16 '17 14:07 gabru-md

What if wget isn't installed

ghost avatar Jul 16 '17 20:07 ghost

@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!

gabru-md avatar Jul 17 '17 06:07 gabru-md

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.

ghost avatar Jul 17 '17 07:07 ghost

@gabru-md Could you assign this issue to me.

ghost avatar Jul 17 '17 20:07 ghost

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!

gabru-md avatar Jul 18 '17 04:07 gabru-md

I'm going to add an npm preinstall hook rather than add the code into accio.js

ghost avatar Jul 18 '17 06:07 ghost

sure :+1:

gabru-md avatar Jul 18 '17 06:07 gabru-md

Heres my pull request #4. It still needs some testing.

ghost avatar Jul 20 '17 01:07 ghost

@gabru-md can you suggest any spell which I can work upon and add it.

ms10398 avatar Oct 25 '17 03:10 ms10398

@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 ?

gabru-md avatar Oct 25 '17 03:10 gabru-md

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.

ms10398 avatar Oct 25 '17 04:10 ms10398

added a spell - nox PR - https://github.com/yogdaan/LinuxSpells/pull/15

Ananthavijay avatar Jun 02 '18 03:06 Ananthavijay