Improve repackage script
This commit is contained in:
parent
2ad9bbf0a6
commit
18edaef4be
|
@ -13,18 +13,31 @@ copy_directory_from_repo () {
|
||||||
git archive master "$dirname" --format=tar | tar xf - -C "$destdir" "${tar_options[@]}"
|
git archive master "$dirname" --format=tar | tar xf - -C "$destdir" "${tar_options[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lite_copy_third_party_modules () {
|
||||||
|
local build="$1"
|
||||||
|
curl --insecure -L "https://github.com/rxi/lite-colors/archive/master.zip" -o "$build/rxi-lite-colors.zip"
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
assets=($(wget --no-check-certificate -q -nv -O- https://api.github.com/repos/franko/lite-xl/releases/latest | grep "browser_download_url" | cut -d '"' -f 4))
|
assets=($(wget --no-check-certificate -q -nv -O- https://api.github.com/repos/franko/lite-xl/releases/latest | grep "browser_download_url" | cut -d '"' -f 4))
|
||||||
|
|
||||||
workdir=".repackage"
|
workdir=".repackage"
|
||||||
rm -fr "$workdir" && mkdir "$workdir" && pushd "$workdir"
|
rm -fr "$workdir" && mkdir "$workdir" && pushd "$workdir"
|
||||||
|
|
||||||
for url in "${assets[@]}"; do
|
for url in "${assets[@]}"; do
|
||||||
wget --no-check-certificate "$url"
|
echo "getting: $url"
|
||||||
|
wget -q --no-check-certificate "$url"
|
||||||
done
|
done
|
||||||
|
|
||||||
for filename in $(ls -1); do
|
lite_copy_third_party_modules "."
|
||||||
|
|
||||||
|
for filename in $(ls -1 *.zip *.tar.*); do
|
||||||
if [[ $filename == *".zip" ]]; then
|
if [[ $filename == *".zip" ]]; then
|
||||||
unzip "$filename"
|
unzip -qq "$filename"
|
||||||
elif [[ $filename == *".tar."* ]]; then
|
elif [[ $filename == *".tar."* ]]; then
|
||||||
tar xf "$filename"
|
tar xf "$filename"
|
||||||
fi
|
fi
|
||||||
|
@ -32,16 +45,22 @@ for filename in $(ls -1); do
|
||||||
xcoredir="$(find lite-xl -type d -name 'core')"
|
xcoredir="$(find lite-xl -type d -name 'core')"
|
||||||
coredir="$(dirname $xcoredir)"
|
coredir="$(dirname $xcoredir)"
|
||||||
echo "coredir: $coredir"
|
echo "coredir: $coredir"
|
||||||
for module_name in core plugins; do
|
cp -r "lite-xl" "lite-xl.original"
|
||||||
|
for module_name in core plugins colors; do
|
||||||
rm -fr "$coredir/$module_name"
|
rm -fr "$coredir/$module_name"
|
||||||
(cd .. && copy_directory_from_repo --strip-components=1 "data/$module_name" "$workdir/$coredir")
|
(cd .. && copy_directory_from_repo --strip-components=1 "data/$module_name" "$workdir/$coredir")
|
||||||
done
|
done
|
||||||
|
for module_name in plugins colors; do
|
||||||
|
cp -r "third/data/$module_name" "$coredir"
|
||||||
|
done
|
||||||
if [[ $filename == *".zip" ]]; then
|
if [[ $filename == *".zip" ]]; then
|
||||||
zip -r -9 "$filename" lite-xl
|
zip -qq -r -9 "$filename" lite-xl
|
||||||
|
diff -U 4 -r lite-xl.original lite-xl > "${filename/%.zip/.diff}"
|
||||||
elif [[ $filename == *".tar."* ]]; then
|
elif [[ $filename == *".tar."* ]]; then
|
||||||
tar czf "${filename/%.tar.*/.tar.gz}" lite-xl
|
tar czf "${filename/%.tar.*/.tar.gz}" lite-xl
|
||||||
|
diff -U 4 -r lite-xl.original lite-xl > "${filename/%.tar.*/.diff}"
|
||||||
fi
|
fi
|
||||||
rm -fr lite-xl
|
rm -fr lite-xl lite-xl.original
|
||||||
done
|
done
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
Loading…
Reference in New Issue