mirror of
https://github.com/vishapoberon/vipatsar.git
synced 2026-04-05 21:12:25 +00:00
convert all existing libraries to new vipakfile format, automatically, with Shell scripts
This commit is contained in:
parent
d1c3a3601f
commit
91191b6b62
33 changed files with 750 additions and 0 deletions
42
convert_vipatsar.sh
Normal file
42
convert_vipatsar.sh
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
|
||||
# convert_vipatsar.sh: Convert old JSON vipakfiles to new plain-text format with
|
||||
# proper file naming and versioning using convert_vipakfile.sh
|
||||
|
||||
# Program name and version
|
||||
PROGNAME=${0##*/}
|
||||
VERSION="0.1.0"
|
||||
|
||||
# Colors for output
|
||||
COLOUR_SET_R="\033[0;31m"
|
||||
COLOUR_SET_G="\033[0;32m"
|
||||
COLOUR_SET_B="\033[0;34m"
|
||||
COLOUR_END="\033[0m"
|
||||
|
||||
# Error, info, and action print functions
|
||||
perror() {
|
||||
printf "${COLOUR_SET_R}[-] ${COLOUR_END}%s\n" "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
pinfo() {
|
||||
printf "${COLOUR_SET_B}[+] ${COLOUR_END}%s\n" "$@" >&2
|
||||
}
|
||||
|
||||
paction() {
|
||||
printf "${COLOUR_SET_G}[*] ${COLOUR_END}%s\n" "$@" >&2
|
||||
}
|
||||
|
||||
# We assume that we're running inside vipatsar tree
|
||||
for dir in $(find . -not -path '*/.git/*' -not -path '.' -type d) ;
|
||||
do
|
||||
# The port/library name is derived from the directory
|
||||
port=${dir##./}
|
||||
pinfo "Working on ${port}"
|
||||
cd $dir
|
||||
paction "Converting ${port}.json"
|
||||
../convert_vipakfile.sh -c "${port}.json"
|
||||
pinfo "Conversion done"
|
||||
|
||||
cd - >/dev/null || return
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue