diff --git a/bin/dev_as_prod b/bin/dev_as_prod index ea7e8cd..5afa697 100755 --- a/bin/dev_as_prod +++ b/bin/dev_as_prod @@ -4,16 +4,18 @@ export RAILS_ENV=production export SECRET_KEY_BASE=42 export SEMANTIC_LOGGER_APP=egr -if [[ -d public/assets ]]; then - echo "ASSETS are already precompiled: MODIFIED_TIME" +function usage { + echo "argument required:" + echo " server" + echo " console" + echo " <...> (any rake entry)" +} + +command=$1 +[[ -z "$command" ]] && usage && exit +if [[ $command =~ 'server|s' ]]; then + [[ -d public/assets ]] && echo "ASSETS are already precompiled: MODIFIED_TIME" || rails assets:precompile + rails server else - rails assets:precompile + rails $command fi - -rails server - -# TO REMOVE PROD assets: -# rm -rf public/assets - -# journalctl --all -o cat --full -t egr -# journalctl --all -o short -full --no-hostname -t egr -f