Skip to content
Snippets Groups Projects
Unverified Commit 557708a9 authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

Chore: Update fuselage.sh script

parent c8af6454
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
if [[ $1 != "undo" ]]; then
if [[ $1 == "--help" || $1 == "-h" ]]; then
echo "Usage: fuselage.sh -a link|undo -p fuselage;fuselage-icons"
exit 1
fi
while getopts ":a:p:" opt; do
case $opt in
a) action="$OPTARG"
;;
p) packages="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
exit 1
;;
esac
case $OPTARG in
-*) echo "Option $opt needs a valid argument"
exit 1
;;
esac
done
echo "action: $action"
action="${action:-link}"
packages="${packages:-fuselage}"
if [[ $action != "link" && $action != "undo" ]]; then
echo "Invalid action"
exit 1
fi
if [[ $action != "undo" ]]; then
echo "linking local project"
else
echo "unlinking local project"
......@@ -8,21 +41,39 @@ fi
cd ./node_modules/@rocket.chat
rm -rf fuselage
if [[ $1 != "undo" ]]; then
ln -s ../../../fuselage/packages/fuselage fuselage
fi
for i in $(echo $packages | tr ";" "\n")
do
rm -rf $i
if [[ $action != "undo" ]]; then
ln -s "../../../fuselage/packages/$i" $i
echo "root $i"
fi
done
cd ../..
cd ./apps/meteor/node_modules/@rocket.chat
rm -rf fuselage
if [[ $1 != "undo" ]]; then
for i in $(echo $packages | tr ";" "\n")
do
rm -rf $i
if [[ $action != "undo" ]]; then
rm -rf $i
fi
done
if [[ $action != "undo" ]]; then
echo "linking local project"
ln -s ../../../../../fuselage/packages/fuselage fuselage
for i in $(echo $packages | tr ";" "\n")
do
ln -s "../../../../../fuselage/packages/$i" $i
echo "apps/meteor $i"
done
fi
cd ../../../../
if [[ $1 == "undo" ]]; then
if [[ $action == "undo" ]]; then
yarn
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment