[add] tools
This commit is contained in:
parent
a6ff47ab61
commit
e5f4f50c75
16
tools/check-json-syntax
Executable file
16
tools/check-json-syntax
Executable file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## consts
|
||||||
|
|
||||||
|
dir_base="."
|
||||||
|
|
||||||
|
|
||||||
|
## exec
|
||||||
|
|
||||||
|
flaws=0
|
||||||
|
for path in $(find ${dir_base} -name "*.json" | sort)
|
||||||
|
do
|
||||||
|
echo "-- ${path}"
|
||||||
|
python3 -m json.tool ${path} > /dev/null || ((flaws+=1))
|
||||||
|
done
|
||||||
|
test ${flaws} -eq 0
|
||||||
24
tools/rename-roll
Executable file
24
tools/rename-roll
Executable file
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## consts
|
||||||
|
|
||||||
|
dir_base="linke/standard"
|
||||||
|
|
||||||
|
|
||||||
|
## args
|
||||||
|
|
||||||
|
name_from=$1 && shift
|
||||||
|
name_to=$1 && shift
|
||||||
|
|
||||||
|
|
||||||
|
## vars
|
||||||
|
|
||||||
|
var_from=$(echo ${name_from} | sed --expression="s|-|_|g" | sed --expression="s|:|_|g")
|
||||||
|
var_to=$(echo ${name_to} | sed --expression="s|-|_|g" | sed --expression="s|:|_|g")
|
||||||
|
|
||||||
|
|
||||||
|
## exec
|
||||||
|
|
||||||
|
git mv ${dir_roles}/roles/${name_from} ${dir_roles}/roles/${name_to}
|
||||||
|
find ${dir_base} -type f -exec sed --in-place --expression="s|var_${var_from}_|var_${var_to}_|g" {} \;
|
||||||
|
find ${dir_base} -type f -exec sed --in-place --expression="s|roles/${name_from}|roles/${name_to}|g" {} \;
|
||||||
Loading…
Reference in a new issue