GiselleSerate / myaliases

Useful shell aliases and functions.
6 stars 1 forks source link

Fix desk command #44

Closed aryarm closed 6 years ago

aryarm commented 6 years ago

This fixes issue #42, at least for now. This certainly makes the desk command more complicated. So if issues with desk come up again, we might want to consider getting rid of the command altogether, especially since cds is perfect for this sort of stuff.

aryarm commented 6 years ago

One benefit to the new version of desk is that it will be faster to use, since the double quotes will force the evaluation of the mess of stuff contained in the subprocess $() when .bash_nav is sourced, instead of each time the alias is called.

The subprocess will open another subprocess to retrieve the current user's profile (ex: C:\Users\gsera) from Windows command line. Then, the first subprocess will use sed to remove everything before the last slash (ex: gsera). This result is echoed into the final alias such that the evaluated code becomes cd /mnt/c/Users/gsera/Desktop. Running alias desk verified that this is indeed the result.

aryarm commented 6 years ago

I messed up and created a fix-desk branch off of the add-alias branch instead of off of master. Oops! See #45 for my second attempt at this pull request.