generated from art-institute-of-chicago/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update link styles script [WEB-2833]
Add the ability to set the link directory from the command line.
- Loading branch information
1 parent
2dc9fde
commit e286a38
Showing
1 changed file
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
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 |