Files
Rabby/scripts/fns.sh
heisenberg b857c87d01 chore: ensure build the is reproducible (#2429)
* chore: ensure build the is reproducible

* chore: lock

* chore: disable sourcemap

* fix: gulp version

* fix: make sure input for `getIdFromNode` stable

* build: test stable zip.

* build: use bash to avoid shellscript syntax error on Linux, cleanup.

* fix: get md5 on linux.

* build: trial.

* chore: update lock file

---------

Co-authored-by: vvvvvv1vvvvvv <galennnnnnn@gmail.com>
Co-authored-by: richardo2016x <richardo2016x@gmail.com>
2024-10-25 16:14:19 +08:00

14 lines
412 B
Bash

# read last_md5_value
get_md5() {
local TARGET_FILE=$1
if [ ! -f $TARGET_FILE ]; then
echo "[get_md5] file not found: $TARGET_FILE"
exit 1
fi
local systype=$(uname -s)
if [ $systype = "Darwin" ]; then
export last_md5_value=$(md5 -q $TARGET_FILE);
elif [ $systype = "Linux" ]; then
export last_md5_value=$(md5sum $TARGET_FILE | awk '{ print $1 }');
fi
}