Last active
August 29, 2015 13:57
-
-
Save bahlo/9660970 to your computer and use it in GitHub Desktop.
Bash function to add support for an Atomfile in APM (Atom Package Manager). Note that this is only a quick hack, until Atom provides an own version of this or makes it's package manager open source.
This file contains hidden or 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
# Put this in your ~/.(bash|zsh|*)rc file | |
# Usage: apm bundle | |
# For an example Atomfile, look here: https://github.com/bahlo/dotfiles/tree/master/atom.symlink | |
function apm() { | |
REAL_APM="/usr/local/bin/apm" | |
if [[ $# -eq 0 ]]; then | |
$REAL_APM $1 | |
echo "<command> can also be bundle." | |
echo | |
elif [[ $1 == "bundle" ]]; then | |
if [[ -f "Atomfile" ]]; then | |
while read line; do | |
if [[ ! -z $line ]]; then | |
$REAL_APM $line | |
fi | |
done < Atomfile | |
else | |
echo "Cannot find Atomfile in current directory" | |
fi | |
else | |
$REAL_APM $1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment