artlog script
This commit is contained in:
@@ -1,4 +1,37 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# SPDX-FileCopyrightText: 2025 artlog@l0g.eu
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
#
|
||||||
|
|
||||||
csv_file="$1"
|
toolsdir=../lib
|
||||||
python3 convert_nextcloud_poll_csv.py "$csv_file" 'Très Bien' 'Bien' 'Assez Bien' 'Passable' 'Insuffisant' 'A Rejeter'
|
pushd $toolsdir >/dev/null
|
||||||
|
toolsdir=$(pwd)
|
||||||
|
source metascript.sh
|
||||||
|
popd >/dev/null
|
||||||
|
|
||||||
|
while [[ $# > 0 ]]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
*)
|
||||||
|
if [[ -z $csv_file ]]
|
||||||
|
then
|
||||||
|
csv_file="$1"
|
||||||
|
else
|
||||||
|
parsemetaarg "$1"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
metarun=metarun
|
||||||
|
|
||||||
|
if [[ -z $csv_file ]]
|
||||||
|
then
|
||||||
|
log_error "Missing csv_file argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
enforcefile "$csv_file" exists
|
||||||
|
|
||||||
|
$metarun python3 convert_nextcloud_poll_csv.py "$csv_file" 'Très Bien' 'Bien' 'Assez Bien' 'Passable' 'Insuffisant' 'A Rejeter'
|
||||||
|
|||||||
@@ -1,25 +1,53 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# SPDX-FileCopyrightText: 2025 artlog@l0g.eu
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
#
|
||||||
|
|
||||||
if [[ $# > 0 ]]
|
toolsdir=../lib
|
||||||
then
|
pushd $toolsdir >/dev/null
|
||||||
|
toolsdir=$(pwd)
|
||||||
|
source metascript.sh
|
||||||
|
popd >/dev/null
|
||||||
|
|
||||||
|
while [[ $# > 0 ]]
|
||||||
|
do
|
||||||
|
case "$1" in
|
||||||
|
*.json)
|
||||||
|
json_file=$1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [[ $1 =~ [0-9]+ ]]
|
||||||
|
then
|
||||||
vote=$1
|
vote=$1
|
||||||
fi
|
else
|
||||||
|
parsemetaarg "$1"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
if [[ -z $vote ]]
|
if [[ -z $vote ]] && [[ -z $json_file ]]
|
||||||
then
|
then
|
||||||
echo "[ERROR] numéro de vote manquant ( ex 1 pour 1.json )"
|
log_error "numéro de vote manquant ( ex 1 pour 1.json )"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
json_file=$vote.json
|
if [[ -z $json_file ]]
|
||||||
json=~/clients/artlog/artisanlogiciel.code/artlog_jsontools/build/json
|
then
|
||||||
|
json_file=$vote.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
enforcefile $json_file exists
|
||||||
|
|
||||||
|
json=json
|
||||||
if [[ -x $json ]]
|
if [[ -x $json ]]
|
||||||
then
|
then
|
||||||
json_indent_file=$vote.indent.json
|
json_indent_file=$vote.indent.json
|
||||||
echo "generating $json_indent_file"
|
echo "generating $json_indent_file"
|
||||||
$json indent=spaces:2 -- $json_file > $json_indent_file
|
$json indent=spaces:2 -- $json_file > $json_indent_file
|
||||||
json=$json_file
|
json_file=$json_indent_file
|
||||||
|
enforcefile $json_file exists
|
||||||
fi
|
fi
|
||||||
|
|
||||||
code_dir=../code/
|
code_dir=../code/
|
||||||
|
|||||||
Reference in New Issue
Block a user