2020-12-03 23:01:01 +01:00
|
|
|
#!/bin/bash
|
|
|
|
rundir=".run"
|
|
|
|
if [ ${1:-x} == "-portable" ]; then
|
|
|
|
bindir="$rundir"
|
|
|
|
datadir="$rundir/data"
|
|
|
|
shift
|
|
|
|
else
|
|
|
|
bindir="$rundir/bin"
|
|
|
|
datadir="$rundir/share/lite-xl"
|
|
|
|
fi
|
|
|
|
|
2020-12-07 17:42:50 +01:00
|
|
|
userdir="$rundir/.lite"
|
|
|
|
|
2020-12-03 23:01:01 +01:00
|
|
|
if [ "$#" -lt 1 ]; then
|
|
|
|
echo "usage: $0 <build-dir>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
builddir="$1"
|
|
|
|
rm -fr "$rundir"
|
2020-12-07 17:42:50 +01:00
|
|
|
mkdir -p "$bindir" "$datadir" "$userdir"
|
2020-12-03 23:01:01 +01:00
|
|
|
if [ -f "$builddir/src/lite" ]; then
|
|
|
|
cp "$builddir/src/lite" "$bindir"
|
|
|
|
elif [ -f "$builddir/src/lite.exe" ]; then
|
|
|
|
cp "$builddir/src/lite.exe" "$bindir"
|
|
|
|
else
|
|
|
|
echo "error: no lite executable found in $builddir/src"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-12-04 12:00:42 +01:00
|
|
|
for module_name in core plugins colors fonts; do
|
2020-12-03 23:01:01 +01:00
|
|
|
cp -r "data/$module_name" "$datadir"
|
|
|
|
done
|
2020-12-07 17:42:50 +01:00
|
|
|
HOME="$userdir" USERPROFILE="$userdir" exec "$bindir/lite" "${@:2}"
|