aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/download-unicode-files.sh19
-rwxr-xr-xscripts/genappimage.sh12
-rwxr-xr-xscripts/git-log-pretty-since.sh14
-rwxr-xr-xscripts/release.sh4
-rwxr-xr-xscripts/update_terminfo.sh2
5 files changed, 23 insertions, 28 deletions
diff --git a/scripts/download-unicode-files.sh b/scripts/download-unicode-files.sh
index 4482cefa34..687b946e6f 100755
--- a/scripts/download-unicode-files.sh
+++ b/scripts/download-unicode-files.sh
@@ -3,11 +3,12 @@
set -e
data_files="UnicodeData.txt CaseFolding.txt EastAsianWidth.txt"
emoji_files="emoji-data.txt"
+files="'$data_files $emoji_files'"
UNIDIR_DEFAULT=src/unicode
DOWNLOAD_URL_BASE_DEFAULT='http://unicode.org/Public'
-if test x$1 = 'x--help' ; then
+if test "$1" = '--help' ; then
echo 'Usage:'
echo " $0[ TARGET_DIRECTORY[ URL_BASE]]"
echo
@@ -16,6 +17,7 @@ if test x$1 = 'x--help' ; then
echo
echo "Default target directory is $PWD/${UNIDIR_DEFAULT}."
echo "Default URL base is ${DOWNLOAD_URL_BASE_DEFAULT}."
+ exit 0
fi
UNIDIR=${1:-$UNIDIR_DEFAULT}
@@ -23,21 +25,12 @@ DOWNLOAD_URL_BASE=${2:-$DOWNLOAD_URL_BASE_DEFAULT}
for filename in $data_files ; do
curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/$filename"
- (
- cd "$UNIDIR"
- git add $filename
- )
+ git -C "$UNIDIR" add "$filename"
done
for filename in $emoji_files ; do
curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/emoji/$filename"
- (
- cd "$UNIDIR"
- git add $filename
- )
+ git -C "$UNIDIR" add $filename
done
-(
- cd "$UNIDIR"
- git commit -m "feat: update unicode tables" -- $files
-)
+git -C "$UNIDIR" commit -m "feat: update unicode tables" .
diff --git a/scripts/genappimage.sh b/scripts/genappimage.sh
index cc88ab5559..9944b5eb31 100755
--- a/scripts/genappimage.sh
+++ b/scripts/genappimage.sh
@@ -8,7 +8,8 @@
# App arch, used by generate_appimage.
if [ -z "$ARCH" ]; then
- export ARCH="$(arch)"
+ ARCH="$(arch)"
+ export ARCH
fi
TAG=$1
@@ -34,8 +35,9 @@ make install
# App version, used by generate_appimage.
VERSION=$("$ROOT_DIR"/build/bin/nvim --version | head -n 1 | grep -o 'v.*')
+export VERSION
-cd "$APP_BUILD_DIR"
+cd "$APP_BUILD_DIR" || exit
# Only downloads linuxdeploy if the remote file is different from local
if [ -e "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage ]; then
@@ -53,7 +55,7 @@ chmod +x "$APP_BUILD_DIR"/linuxdeploy-x86_64.AppImage
mkdir "$APP_DIR/usr/share/metainfo/"
cp "$ROOT_DIR/runtime/nvim.appdata.xml" "$APP_DIR/usr/share/metainfo/"
-cd "$APP_DIR"
+cd "$APP_DIR" || exit
########################################################################
# AppDir complete. Now package it as an AppImage.
@@ -71,7 +73,7 @@ exec "$(dirname "$(readlink -f "${0}")")/usr/bin/nvim" ${@+"$@"}
EOF
chmod 755 AppRun
-cd "$APP_BUILD_DIR" # Get out of AppImage directory.
+cd "$APP_BUILD_DIR" || exit # Get out of AppImage directory.
# Set the name of the file generated by appimage
export OUTPUT=nvim.appimage
@@ -85,7 +87,7 @@ fi
# - Expects: $ARCH, $APP, $VERSION env vars
# - Expects: ./$APP.AppDir/ directory
# - Produces: ./nvim.appimage
-./linuxdeploy-x86_64.AppImage --appdir $APP.AppDir -d $ROOT_DIR/runtime/nvim.desktop -i \
+./linuxdeploy-x86_64.AppImage --appdir $APP.AppDir -d "$ROOT_DIR"/runtime/nvim.desktop -i \
"$ROOT_DIR/runtime/nvim.png" --output appimage
# Moving the final executable to a different folder so it isn't in the
diff --git a/scripts/git-log-pretty-since.sh b/scripts/git-log-pretty-since.sh
index a0aa4354b6..95dcee23f5 100755
--- a/scripts/git-log-pretty-since.sh
+++ b/scripts/git-log-pretty-since.sh
@@ -16,9 +16,9 @@ __SINCE=$1
__INVMATCH=$2
is_merge_commit() {
- git rev-parse $1 >/dev/null 2>&1 \
+ git rev-parse "$1" >/dev/null 2>&1 \
|| { echo "ERROR: invalid commit: $1"; exit 1; }
- git log $1^2 >/dev/null 2>&1 && return 0 || return 1
+ git log "$1"^2 >/dev/null 2>&1 && return 0 || return 1
}
# Removes parens from issue/ticket/PR numbers.
@@ -40,13 +40,13 @@ _format_ticketnums() {
}
for commit in $(git log --format='%H' --first-parent "$__SINCE"..HEAD); do
- if is_merge_commit ${commit} ; then
- if [ -z "$__INVMATCH" ] || ! git log --oneline ${commit}^1..${commit}^2 \
+ if is_merge_commit "${commit}" ; then
+ if [ -z "$__INVMATCH" ] || ! git log --oneline "${commit}^1..${commit}^2" \
| >/dev/null 2>&1 grep -E "$__INVMATCH" ; then
- git log -1 --oneline ${commit}
- git log --format=' %h %s' ${commit}^1..${commit}^2
+ git log -1 --oneline "${commit}"
+ git log --format=' %h %s' "${commit}^1..${commit}^2"
fi
else
- git log -1 --oneline ${commit}
+ git log -1 --oneline "${commit}"
fi
done | _format_ticketnums
diff --git a/scripts/release.sh b/scripts/release.sh
index 380503662d..4321d96f62 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -59,8 +59,8 @@ _do_release_commit() {
$__sed -i.bk 's/(NVIM_VERSION_PRERELEASE) "-dev"/\1 ""/' CMakeLists.txt
if grep '(NVIM_API_PRERELEASE true)' CMakeLists.txt > /dev/null; then
$__sed -i.bk 's/(NVIM_API_PRERELEASE) true/\1 false/' CMakeLists.txt
- build/bin/nvim --api-info > test/functional/fixtures/api_level_$__API_LEVEL.mpack
- git add test/functional/fixtures/api_level_$__API_LEVEL.mpack
+ build/bin/nvim --api-info > "test/functional/fixtures/api_level_$__API_LEVEL.mpack"
+ git add "test/functional/fixtures/api_level_${__API_LEVEL}.mpack"
fi
$__sed -i.bk 's,(<releases>),\1\
diff --git a/scripts/update_terminfo.sh b/scripts/update_terminfo.sh
index 8a0937cc8c..775048f246 100755
--- a/scripts/update_terminfo.sh
+++ b/scripts/update_terminfo.sh
@@ -35,7 +35,7 @@ readonly -A entries=(
db="$(mktemp -du)"
print_bold() {
- printf "\\e[1m$*\\e[0m"
+ printf "\\e[1m%b\\e[0m" "$*"
}
cd "$(git rev-parse --show-toplevel)"