From 8191148f7326fa31e0422c0fcc1da99a222d6e14 Mon Sep 17 00:00:00 2001 From: pvincent Date: Wed, 25 Sep 2024 11:41:55 +0400 Subject: [PATCH] dev_as_prod server, console, rake --- bin/dev_as_prod | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) 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