Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordansissel/11232938 to your computer and use it in GitHub Desktop.
Save jordansissel/11232938 to your computer and use it in GitHub Desktop.
% fpm -s dir -t sh -n example -v 1.0 $HOME/.{vim,zsh}rc
Created package {:path=>"example.sh"}
% ./example.sh -h
Usage: example.sh [options]
Install this package
-i <DIRECTORY> : install_root - an optional directory to install to.
Default is package file name without file extension
-o <USER> : owner - the name of the user that will own the files installed
by the package. Defaults to current user
-r: disable capistrano style release directories - Default behavior is to create a releases directory inside
install_root and unpack contents into a date stamped (or build time id named) directory under the release
directory. Then create a 'current' symlink under install_root to the unpacked
directory once installation is complete replacing the symlink if it already
exists. If this flag is set just install into install_root directly
-u: Unpack the package, but do not install and symlink the payload
-f: force - Always overwrite existing installations
-y: yes - Don't prompt to clobber existing installations
-v: verbose - More output on installation
-h: help - Display this message
% sudo ./example.sh -i /opt/example/
% ls -l /opt/example/
total 8
lrwxr-xr-x 1 root wheel 37 Apr 23 14:24 current@ -> /opt/example//releases/20140423142413
drwxr-xr-x 3 root wheel 102 Apr 23 14:24 releases/
% sudo find /opt/example
/opt/example
/opt/example/.install-metadata
/opt/example/current
/opt/example/releases
/opt/example/releases/20140423142413
/opt/example/releases/20140423142413/Users
/opt/example/releases/20140423142413/Users/jls
/opt/example/releases/20140423142413/Users/jls/.vimrc
/opt/example/releases/20140423142413/Users/jls/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment