Skip to content

Instantly share code, notes, and snippets.

@KensoDev
Created January 3, 2017 20:36
Show Gist options
  • Select an option

  • Save KensoDev/ca05a9cd17ab60d6aa44f1458602658b to your computer and use it in GitHub Desktop.

Select an option

Save KensoDev/ca05a9cd17ab60d6aa44f1458602658b to your computer and use it in GitHub Desktop.
path=$1
random_string=`date +%s | gsha256sum | base64 | head -c 32`
echo "Compiling..."
NODE_ENV=production webpack -p --progress --colors --config ./webpack.prod.config.js
echo "Moving files..."
cd dist/
mkdir -p $path/www_rails/public/new-map
rm -f $path/www_rails/public/map-files/*.*
mv bundle.js $path/www_rails/public/new-map/$random_string-bundle.js
mkdir -p $path/www_rails/public/map-files
mv *.png $path/www_rails/public/map-files
mv *.gif $path/www_rails/public/map-files
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment