chore: rename create_conf script then lefthook analyse it when commit
This commit is contained in:
parent
f113664131
commit
5ff1e36a53
2 changed files with 31 additions and 37 deletions
|
@ -14,6 +14,6 @@ in
|
||||||
frei0r
|
frei0r
|
||||||
inkscape
|
inkscape
|
||||||
];
|
];
|
||||||
home.file.".local/bin/create_conf".source = ./files/create_conf;
|
home.file.".local/bin/create_conf".source = ./files/create_conf.sh;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
error() {
|
error() {
|
||||||
printf -v message "\e[31mERROR:\e[0m %s\n" "$1"
|
printf -v message "\e[31mERROR:\e[0m %s\n" "$1"
|
||||||
message="${message} \e[1mStack trace\e[0m:\n"
|
message="${message} \e[1mStack trace\e[0m:\n"
|
||||||
for (( i=1; i<${#FUNCNAME[@]}; i++ ))
|
for ((i = 1; i < ${#FUNCNAME[@]}; i++)); do
|
||||||
do
|
|
||||||
if [[ $i = $((${#FUNCNAME[@]} - 1)) ]]; then
|
if [[ $i = $((${#FUNCNAME[@]} - 1)) ]]; then
|
||||||
message="${message} └"
|
message="${message} └"
|
||||||
else
|
else
|
||||||
|
@ -36,6 +35,7 @@ process_args() {
|
||||||
*)
|
*)
|
||||||
conf="$*"
|
conf="$*"
|
||||||
break
|
break
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
@ -87,14 +87,10 @@ get_file_hash() {
|
||||||
|
|
||||||
file=$1
|
file=$1
|
||||||
file_size=${2:-1}
|
file_size=${2:-1}
|
||||||
if (( file_size != -1 ))
|
if ((file_size != -1)); then
|
||||||
then
|
if [[ -f "$file" ]]; then
|
||||||
if [ -f "$file" ]
|
if ((file_size > 0)); then
|
||||||
then
|
if ((file_size > 2000000)); then
|
||||||
if (( file_size > 0 ))
|
|
||||||
then
|
|
||||||
if (( file_size > 2000000 ))
|
|
||||||
then
|
|
||||||
#calculate
|
#calculate
|
||||||
local tmp_file
|
local tmp_file
|
||||||
tmp_file=mktemp
|
tmp_file=mktemp
|
||||||
|
@ -140,8 +136,7 @@ get_file_size() {
|
||||||
fi
|
fi
|
||||||
local file
|
local file
|
||||||
file=$1
|
file=$1
|
||||||
if [ -f "$file" ]
|
if [[ -f "$file" ]]; then
|
||||||
then
|
|
||||||
wc -c <"$file"
|
wc -c <"$file"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
@ -196,7 +191,6 @@ function main() {
|
||||||
# create it
|
# create it
|
||||||
mkdir "${folder}/"{rushes,audio,titles} -p || die "folder creation failed"
|
mkdir "${folder}/"{rushes,audio,titles} -p || die "folder creation failed"
|
||||||
|
|
||||||
|
|
||||||
cp "${base_dir}/logo_amis.svg" "${folder}/titles" || die "SVG copy failed!"
|
cp "${base_dir}/logo_amis.svg" "${folder}/titles" || die "SVG copy failed!"
|
||||||
cp "${base_dir}/template.kdenlive" "${folder}/montage.kdenlive" || die "Template copy failed!"
|
cp "${base_dir}/template.kdenlive" "${folder}/montage.kdenlive" || die "Template copy failed!"
|
||||||
|
|
||||||
|
@ -209,7 +203,7 @@ function main() {
|
||||||
sed -i "s/\[\[date\]\]/${inkscape_date}/g" "${folder}/titles/logo_amis.svg" || die "Change date failed!"
|
sed -i "s/\[\[date\]\]/${inkscape_date}/g" "${folder}/titles/logo_amis.svg" || die "Change date failed!"
|
||||||
|
|
||||||
printf "Export SVG title \n"
|
printf "Export SVG title \n"
|
||||||
inkscape --export-type="png" "${folder}/titles/logo_amis.svg" || die "Export failed"
|
inkscape --export-type="png" "${folder}/titles/logo_amis.svg" || die "SVG export failed"
|
||||||
|
|
||||||
printf "Importing PNG File in %s/montage.kdenlive \n" "$folder"
|
printf "Importing PNG File in %s/montage.kdenlive \n" "$folder"
|
||||||
insert_media "$folder/titles/logo_amis.png" "logo"
|
insert_media "$folder/titles/logo_amis.png" "logo"
|
Loading…
Add table
Add a link
Reference in a new issue