Last active
November 14, 2016 17:16
-
-
Save willishq/5bb97e10176d540d2b3a52202cca0d54 to your computer and use it in GitHub Desktop.
Creates a symlink from the storage/public directory to public/storage, optionally takes an argument to name the link something other than public/storage
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
storagedir="$(pwd)/storage/app/public" | |
publicdir="$(pwd)/public" | |
linkfile="${publicdir}/${*:-storage}"; | |
if [ -d $storagedir ] && [ -d $publicdir ]; then | |
if [ -L $linkfile ]; then | |
rm $linkfile; | |
fi | |
ln -s $storagedir $linkfile | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment