Skip to content

Commit 52522d0

Browse files
authored
refactor: rewrite amalgamation_version.sh for POSIX shell
1 parent a28d6ce commit 52522d0

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

amalgamation_version.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/bin/sh
22
# Used to generate the version for the amalgamation download zip.
33
# https://www.sqlite.org/download.html#encoding
44
# The version is encoded so that filenames sort in order of increasing version number when viewed using "ls".
@@ -7,13 +7,13 @@ version=""
77
i=0
88
export IFS="."
99
for num in $1; do
10-
if [ $i -gt 0 ]; then
11-
if [ $num -le 9 ]; then
12-
eval num=0$num
13-
fi
14-
fi
15-
eval version=$version$num
16-
let i+=1
10+
if [ $i -gt 0 ]; then
11+
case $num in
12+
[0-9]) num=0$num ;;
13+
esac
14+
fi
15+
version="${version}${num}"
16+
i=$((i+1))
1717
done
1818
unset IFS
1919
if [ $i -gt 3 ]; then

0 commit comments

Comments
 (0)