Renamed dev-utils directory to scripts
This commit is contained in:
@@ -0,0 +1,130 @@
|
||||
{
|
||||
"name": "icons",
|
||||
"css_prefix_text": "icon-",
|
||||
"css_use_suffix": false,
|
||||
"hinting": true,
|
||||
"units_per_em": 1000,
|
||||
"ascent": 850,
|
||||
"glyphs": [
|
||||
{
|
||||
"uid": "9dd9e835aebe1060ba7190ad2b2ed951",
|
||||
"css": "search-1",
|
||||
"code": 76,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "c76b7947c957c9b78b11741173c8349b",
|
||||
"css": "attention-1",
|
||||
"code": 33,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "1b5a5d7b7e3c71437f5a26befdd045ed",
|
||||
"css": "doc-1",
|
||||
"code": 102,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "f8aa663c489bcbd6e68ec8147dca841e",
|
||||
"css": "folder-1",
|
||||
"code": 100,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "c95735c17a10af81448c7fed98a04546",
|
||||
"css": "folder-open-1",
|
||||
"code": 68,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "e99461abfef3923546da8d745372c995",
|
||||
"css": "cog",
|
||||
"code": 80,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "7bf14281af5633a597f85b061ef1cfb9",
|
||||
"css": "angle-right",
|
||||
"code": 43,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "e4dde1992f787163e2e2b534b8c8067d",
|
||||
"css": "angle-down",
|
||||
"code": 45,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "ea2d9a8c51ca42b38ef0d2a07f16d9a7",
|
||||
"css": "chart-line",
|
||||
"code": 103,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "f4445feb55521283572ee88bc304f928",
|
||||
"css": "floppy",
|
||||
"code": 83,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "9755f76110ae4d12ac5f9466c9152031",
|
||||
"css": "book",
|
||||
"code": 66,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "e82cedfa1d5f15b00c5a81c9bd731ea2",
|
||||
"css": "info-circled-1",
|
||||
"code": 105,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "5211af474d3a9848f67f945e2ccaf143",
|
||||
"css": "cancel-1",
|
||||
"code": 67,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "04f022b8bd044d4ccfffd3887ff72088",
|
||||
"css": "window-minimize",
|
||||
"code": 95,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "d0e62145dbf40f30e47b3819b8b43a8f",
|
||||
"css": "window-restore",
|
||||
"code": 119,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "7394501fc0b17cb7bda99538f92e26d6",
|
||||
"css": "window-close",
|
||||
"code": 88,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "559647a6f430b3aeadbecd67194451dd",
|
||||
"css": "menu-1",
|
||||
"code": 77,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "07f0832c07f3d9713fffb06c8bffa027",
|
||||
"css": "window-maximize",
|
||||
"code": 87,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "d870630ff8f81e6de3958ecaeac532f2",
|
||||
"css": "left-open",
|
||||
"code": 60,
|
||||
"src": "fontawesome"
|
||||
},
|
||||
{
|
||||
"uid": "399ef63b1e23ab1b761dfbb5591fa4da",
|
||||
"css": "right-open",
|
||||
"code": 62,
|
||||
"src": "fontawesome"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
#!/bin/bash
|
||||
|
||||
# strip-components is normally set to 1 to strip the initial "data" from the
|
||||
# directory path.
|
||||
copy_directory_from_repo () {
|
||||
local tar_options=()
|
||||
if [[ $1 == --strip-components=* ]]; then
|
||||
tar_options+=($1)
|
||||
shift
|
||||
fi
|
||||
local dirname="$1"
|
||||
local destdir="$2"
|
||||
git archive master "$dirname" --format=tar | tar xf - -C "$destdir" "${tar_options[@]}"
|
||||
}
|
||||
|
||||
lite_copy_third_party_modules () {
|
||||
local build="$1"
|
||||
curl --retry 5 --retry-delay 3 --insecure -L "https://github.com/rxi/lite-colors/archive/master.zip" -o "$build/rxi-lite-colors.zip" || exit 1
|
||||
mkdir -p "$build/third/data/colors" "$build/third/data/plugins"
|
||||
unzip -qq "$build/rxi-lite-colors.zip" -d "$build"
|
||||
mv "$build/lite-colors-master/colors" "$build/third/data"
|
||||
rm -fr "$build/lite-colors-master"
|
||||
rm "$build/rxi-lite-colors.zip"
|
||||
}
|
||||
|
||||
while [ ! -z ${1+x} ]; do
|
||||
case "$1" in
|
||||
-dir)
|
||||
use_dir="$(realpath $2)"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "unknown option: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
wget="wget --retry-connrefused --waitretry=1 --read-timeout=20 --no-check-certificate"
|
||||
|
||||
workdir=".repackage"
|
||||
rm -fr "$workdir" && mkdir "$workdir" && pushd "$workdir"
|
||||
|
||||
fetch_packages_from_github () {
|
||||
assets=($($wget -q -nv -O- https://api.github.com/repos/franko/lite-xl/releases/latest | grep "browser_download_url" | cut -d '"' -f 4))
|
||||
|
||||
for url in "${assets[@]}"; do
|
||||
echo "getting: $url"
|
||||
$wget -q "$url" || exit 1
|
||||
done
|
||||
}
|
||||
|
||||
fetch_packages_from_dir () {
|
||||
for file in "$1"/*.zip "$1"/*.tar.* ; do
|
||||
echo "copying file $file"
|
||||
cp "$file" .
|
||||
done
|
||||
}
|
||||
|
||||
if [ -z ${use_dir+x} ]; then
|
||||
fetch_packages_from_github
|
||||
else
|
||||
fetch_packages_from_dir "$use_dir"
|
||||
fi
|
||||
|
||||
lite_copy_third_party_modules "."
|
||||
|
||||
for filename in $(ls -1 *.zip *.tar.*); do
|
||||
if [[ $filename == *".zip" ]]; then
|
||||
unzip -qq "$filename"
|
||||
elif [[ $filename == *".tar."* ]]; then
|
||||
tar xf "$filename"
|
||||
fi
|
||||
rm "$filename"
|
||||
find lite-xl -name lite -exec chmod a+x '{}' \;
|
||||
xcoredir="$(find lite-xl -type d -name 'core')"
|
||||
coredir="$(dirname $xcoredir)"
|
||||
echo "coredir: $coredir"
|
||||
cp -r "lite-xl" "lite-xl.original"
|
||||
for module_name in core plugins colors; do
|
||||
rm -fr "$coredir/$module_name"
|
||||
(cd .. && copy_directory_from_repo --strip-components=1 "data/$module_name" "$workdir/$coredir")
|
||||
done
|
||||
for module_name in plugins colors; do
|
||||
cp -r "third/data/$module_name" "$coredir"
|
||||
done
|
||||
if [[ $filename == *".zip" ]]; then
|
||||
zip -qq -r -9 "$filename" lite-xl
|
||||
diff -U 4 -r lite-xl.original lite-xl > "${filename/%.zip/.diff}"
|
||||
elif [[ $filename == *".tar."* ]]; then
|
||||
tar czf "${filename/%.tar.*/.tar.gz}" lite-xl
|
||||
diff -U 4 -r lite-xl.original lite-xl > "${filename/%.tar.*/.diff}"
|
||||
fi
|
||||
rm -fr lite-xl lite-xl.original
|
||||
done
|
||||
|
||||
popd
|
||||
|
||||
Executable
+119
@@ -0,0 +1,119 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
|
||||
# accept argument in the form
|
||||
github_raw_content () {
|
||||
echo "https://raw.githubusercontent.com/$1"
|
||||
}
|
||||
|
||||
option_portable=off
|
||||
option_copy=on
|
||||
pargs=()
|
||||
plugins=()
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
-portable)
|
||||
option_portable=on
|
||||
;;
|
||||
-keep)
|
||||
option_copy=off
|
||||
;;
|
||||
-plugin=*)
|
||||
# should be like -plugin=franko/lite-plugins/master/plugins/autowrap.lua
|
||||
plugins+=("${1#-plugin=}")
|
||||
;;
|
||||
-global)
|
||||
option_global=on
|
||||
;;
|
||||
-*)
|
||||
echo "error: unknown option \"$1\""
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
pargs+=("$1")
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "${#pargs[@]}" -lt 1 ]; then
|
||||
echo "usage: $0 [options] <build-dir>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "mingw"* ]]; then
|
||||
run_windows=yes
|
||||
fi
|
||||
|
||||
rundir=".run"
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
bindir="$rundir"
|
||||
datadir="$rundir"
|
||||
elif [ "$option_portable" == on ]; then
|
||||
bindir="$rundir"
|
||||
datadir="$rundir/data"
|
||||
else
|
||||
bindir="$rundir/bin"
|
||||
datadir="$rundir/share/lite-xl"
|
||||
fi
|
||||
|
||||
userdir="$(realpath "$rundir")"
|
||||
builddir="${pargs[0]}"
|
||||
|
||||
build_lite () {
|
||||
echo "running ninja"
|
||||
ninja -C "$builddir"
|
||||
}
|
||||
|
||||
copy_lite_build () {
|
||||
echo "copying lite executable and data"
|
||||
rm -fr "$rundir"
|
||||
mkdir -p "$bindir" "$datadir"
|
||||
if [ ! -z ${run_windows+x} ]; then
|
||||
cp "$builddir/src/lite.exe" "$bindir"
|
||||
else
|
||||
cp "$builddir/src/lite" "$bindir"
|
||||
fi
|
||||
for module_name in core plugins colors fonts; do
|
||||
cp -r "data/$module_name" "$datadir"
|
||||
done
|
||||
}
|
||||
|
||||
run_lite () {
|
||||
if [ ! -z ${option_global+x} ]; then
|
||||
echo "running \"lite ${pargs[@]:1}\""
|
||||
exec "$bindir/lite" "${pargs[@]:1}"
|
||||
else
|
||||
echo "running \"lite ${pargs[@]:1}\" with local HOME"
|
||||
if [ ! -z ${run_windows+x} ]; then
|
||||
USERPROFILE="$userdir" exec "$bindir/lite" "${pargs[@]:1}"
|
||||
else
|
||||
HOME="$userdir" exec "$bindir/lite" "${pargs[@]:1}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
github_raw_content () {
|
||||
echo "https://raw.githubusercontent.com/$1"
|
||||
}
|
||||
|
||||
fetch_plugins () {
|
||||
for name in "$@"; do
|
||||
local url="$(github_raw_content "$name")"
|
||||
local modname="${url##*/}"
|
||||
if [ "$modname" == init.lua ]; then
|
||||
local m1="${name#*/}"
|
||||
modname="${m1%%/*}.lua"
|
||||
fi
|
||||
echo "installed $name as $modname from $url"
|
||||
curl --insecure -L "$url" -o "$datadir/plugins/${modname}"
|
||||
done
|
||||
}
|
||||
|
||||
if [ $option_copy == on ]; then
|
||||
build_lite
|
||||
copy_lite_build
|
||||
fi
|
||||
fetch_plugins "${plugins[@]}"
|
||||
run_lite
|
||||
Executable
+87
@@ -0,0 +1,87 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
|
||||
option_copy=on
|
||||
pargs=()
|
||||
while [[ "$#" -gt 0 ]]; do
|
||||
case $1 in
|
||||
-keep)
|
||||
option_copy=off
|
||||
;;
|
||||
-global)
|
||||
option_global=on
|
||||
;;
|
||||
-*)
|
||||
echo "error: unknown option \"$1\""
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
pargs+=("$1")
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "${#pargs[@]}" -lt 3 ]; then
|
||||
echo "usage: $0 [options] <plugin-dir> <plugin-name> <build-dir>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
plugin_dir="${pargs[0]}"
|
||||
plugin="${pargs[1]}"
|
||||
|
||||
if [[ "$OSTYPE" == "msys"* || "$OSTYPE" == "mingw"* ]]; then
|
||||
run_windows=yes
|
||||
fi
|
||||
|
||||
rundir=".run"
|
||||
bindir="$rundir/bin"
|
||||
datadir="$rundir/share/lite-xl"
|
||||
|
||||
userdir="$(realpath "$rundir")"
|
||||
builddir="${pargs[2]}"
|
||||
|
||||
build_lite () {
|
||||
echo "running ninja"
|
||||
ninja -C "$builddir"
|
||||
}
|
||||
|
||||
copy_lite_build () {
|
||||
echo "copying lite executable and data"
|
||||
rm -fr "$rundir"
|
||||
mkdir -p "$bindir" "$datadir"
|
||||
if [ ! -z ${run_windows+x} ]; then
|
||||
cp "$builddir/src/lite.exe" "$bindir"
|
||||
else
|
||||
cp "$builddir/src/lite" "$bindir"
|
||||
fi
|
||||
for module_name in core plugins colors fonts; do
|
||||
cp -r "data/$module_name" "$datadir"
|
||||
done
|
||||
}
|
||||
|
||||
run_lite () {
|
||||
if [ ! -z ${option_global+x} ]; then
|
||||
echo "running \"lite ${pargs[@]:3}\""
|
||||
exec "$bindir/lite" "${pargs[@]:3}"
|
||||
else
|
||||
echo "running \"lite ${pargs[@]:3}\" with local HOME"
|
||||
if [ ! -z ${run_windows+x} ]; then
|
||||
USERPROFILE="$userdir" exec "$bindir/lite" "${pargs[@]:3}"
|
||||
else
|
||||
HOME="$userdir" exec "$bindir/lite" "${pargs[@]:3}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
copy_plugin () {
|
||||
echo "-- lite-xl 1.16" | cat - "$plugin_dir/$plugin.lua" > "$datadir/plugins/$plugin.lua"
|
||||
}
|
||||
|
||||
if [ $option_copy == on ]; then
|
||||
build_lite
|
||||
copy_lite_build
|
||||
fi
|
||||
copy_plugin
|
||||
run_lite
|
||||
Reference in New Issue
Block a user