Skip to content

Instantly share code, notes, and snippets.

@bahlo
Last active August 29, 2015 13:57
Show Gist options
  • Save bahlo/9660970 to your computer and use it in GitHub Desktop.
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.
# 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