Files
sxmo-utils/setup_config_version.sh
Willow Barraco b730f4562f Use a single font: deja vu mono nerd font
Signed-off-by: Willow Barraco <contact@willowbarraco.fr>
Signed-off-by: Peter John Hartman <peterjohnhartman@gmail.com>
2023-03-23 13:42:43 -05:00

30 lines
425 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
case "$1" in
*.json)
# we ignore json files
exit
esac
case "$(busybox head -n1 "$1")" in
"#"*)
comment="#"
;;
!*)
comment="!"
;;
--*)
comment="--"
;;
*)
exit # we skip this file
;;
esac
busybox md5sum "$1" | \
busybox cut -d" " -f1 | \
busybox xargs -I{} busybox sed -i "2i$comment configversion: {}" \
"$1"