Skip to content

Commit

Permalink
Update link styles script [WEB-2833]
Browse files Browse the repository at this point in the history
Add the ability to set the link directory from the command line.
  • Loading branch information
zachgarwood committed May 7, 2024
1 parent 2dc9fde commit e286a38
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions link-website-styles.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
#! /bin/bash

# Run this from the root of the my-museum-tour project to symlink museum
# website styles with this project. A few assumptions are made here:
# website styles with this project. Use the -l|--link option to set the
# directory of website project, otherwise the `website/` directory will be used.
#
# A few assumptions are made here:
#
# 1. You have the website and this package in neighboring folders
# 2. You have run `npm run dev` in the website project to compile styles
# 3. You are _not_ running the with the `USE_COMPILED_REVASSETS` flag
# turned on.

LINK_DIR="website/" # Default website project directory

while :; do
case $1 in
-l|--link)
if [[ $2 ]]; then
LINK_DIR="$2"
shift 2
fi
;;
*)
break
esac
done

# Add a trailing slash if absent
if [[ $LINK_DIR != *"/" ]]; then
LINK_DIR="$LINK_DIR"/
fi

mkdir dist/scripts
mkdir dist/styles

ln -s ../../../website/public/dist/scripts/app.js dist/scripts/app.js
ln -s ../../../website/public/dist/scripts/head.js dist/scripts/head.js
ln -sv ../../../"$LINK_DIR"public/dist/scripts/app.js dist/scripts/app.js
ln -sv ../../../"$LINK_DIR"public/dist/scripts/head.js dist/scripts/head.js

ln -s ../../../website/public/dist/styles/setup.css dist/styles/setup.css
ln -s ../../../website/public/dist/styles/app.css dist/styles/app.css
ln -s ../../../website/public/dist/styles/print.css dist/styles/print.css
ln -sv ../../../"$LINK_DIR"public/dist/styles/setup.css dist/styles/setup.css
ln -sv ../../../"$LINK_DIR"public/dist/styles/app.css dist/styles/app.css
ln -sv ../../../"$LINK_DIR"public/dist/styles/print.css dist/styles/print.css

0 comments on commit e286a38

Please sign in to comment.