-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
teleport.sh
executable file
·69 lines (54 loc) · 1.76 KB
/
teleport.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
#
# ------------------------------------------------------------------------
# Copyright (c) 2018-2024 Alexandre Bento Freire. All rights reserved.
# Licensed under the MIT License.
# ------------------------------------------------------------------------
# this script is designed only for testing teleport in a bash enviroment
# using `abeamer serve` as a live server.
# e.g. ./teleport.sh ./gallery/animate-colors
if [ "$1" == "" ]; then
echo "usage: ./teleport.sh [--gif] [PORT] (FOLDER)"
else
GEN_GIF=0
if [ "$1" == "--gif" ]; then
GEN_GIF=1
shift
fi
PORT=$1
PARAM_TEST=${PORT//[0-9]}
if [ "$PARAM_TEST" != "" ]; then
PORT=9000
else
shift
fi
FOLDER=$1
shift
FOLDER=${FOLDER%/}
if [ ! -d "$FOLDER" ]; then
echo "$FOLDER doesn't not exist"
exit -1
fi
echo $FOLDER
RS_FOLDER=./gallery/remote-server
echo ./live-render.sh $PORT "$FOLDER" --teleport "$@"
./live-render.sh $PORT "$FOLDER" --teleport "$@"
echo rm -rf "$RS_FOLDER/assets"
rm -rf "$RS_FOLDER/assets"
echo cp -r "$FOLDER/assets" "$RS_FOLDER"
cp -r "$FOLDER/assets" "$RS_FOLDER"
echo cp "$FOLDER/story.json" "$RS_FOLDER/story.json"
cp "$FOLDER/story.json" "$RS_FOLDER/story.json"
DRS_FOLDER=${RS_FOLDER//\.\//}
URL="http://localhost:$PORT/$DRS_FOLDER/"
CONFIG="$RS_FOLDER/story.json"
echo node ./cli/abeamer-cli.js render "$@" --dp --url "$URL" --config "$CONFIG" \
--allowed-plugins "$RS_FOLDER/.allowed-plugins.json" \
--inject-page "$RS_FOLDER/index.html"
node ./cli/abeamer-cli.js render "$@" --dp --url "$URL" --config "$CONFIG" \
--allowed-plugins "$RS_FOLDER/.allowed-plugins.json" \
--inject-page "$RS_FOLDER/index.html"
if [ $GEN_GIF == 1 ]; then
node ./cli/abeamer-cli.js gif "$RS_FOLDER/"
fi
fi