-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·52 lines (49 loc) · 1.37 KB
/
package.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
#!/usr/bin/env bash
cd "$(dirname "$0")"
export SCRIPT_DIR="$(pwd)"
export PACKAGE_NAME=LRLastModified
export TARGET_DIR_MAC="$SCRIPT_DIR/target/mac/Library/Application Support/Adobe/Lightroom"
export TARGET_DIR_WIN="$SCRIPT_DIR/target/win/AppData/Roaming/Adobe/Lightroom"
export SOURCE_DIR=$SCRIPT_DIR/src/main/lua/$PACKAGE_NAME.lrdevplugin
export RESOURCE_DIR=$SCRIPT_DIR/res
export VERSION=1.1.1.1
#
# mac
#
if [ -d "$TARGET_DIR_MAC" ]; then
rm -d -f -r "$TARGET_DIR_MAC"
fi
rm $SCRIPT_DIR/target/$PACKAGE_NAME$VERSION"_mac.zip"
mkdir -p "$TARGET_DIR_MAC/Modules/$PACKAGE_NAME.lrplugin"
# copy dev
cp -R $SOURCE_DIR/* "$TARGET_DIR_MAC/Modules/$PACKAGE_NAME.lrplugin"
# compile
cd "$TARGET_DIR_MAC/Modules/$PACKAGE_NAME.lrplugin"
for f in *.lua
do
luac5.1 -o $f $f
done
cd $RESOURCE_DIR
#cp -R * "$TARGET_DIR_MAC"
cd "$SCRIPT_DIR/target/mac"
zip -q -r ../$PACKAGE_NAME$VERSION"_mac.zip" Library
#
# win
#
if [ -d "$TARGET_DIR_WIN" ]; then
rm -d -f -r "$TARGET_DIR_WIN"
fi
rm $SCRIPT_DIR/target/$PACKAGE_NAME$VERSION"_win.zip"
mkdir -p "$TARGET_DIR_WIN/Modules/$PACKAGE_NAME.lrplugin"
# copy dev
cp -R $SOURCE_DIR/* "$TARGET_DIR_WIN/Modules/$PACKAGE_NAME.lrplugin"
# compile
cd "$TARGET_DIR_WIN/Modules/$PACKAGE_NAME.lrplugin"
for f in *.lua
do
luac5.1 -o $f $f
done
cd $RESOURCE_DIR
#cp -R * "$TARGET_DIR_WIN"
cd $SCRIPT_DIR/target/win
zip -q -r ../$PACKAGE_NAME$VERSION"_win.zip" AppData