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
|
||||
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() {
|
||||
printf -v message "\e[31mERROR:\e[0m %s\n" "$1"
|
||||
message="${message} \e[1mStack trace\e[0m:\n"
|
||||
for (( i=1; i<${#FUNCNAME[@]}; i++ ))
|
||||
do
|
||||
for ((i = 1; i < ${#FUNCNAME[@]}; i++)); do
|
||||
if [[ $i = $((${#FUNCNAME[@]} - 1)) ]]; then
|
||||
message="${message} └"
|
||||
else
|
||||
|
@ -36,6 +35,7 @@ process_args() {
|
|||
*)
|
||||
conf="$*"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
@ -87,14 +87,10 @@ get_file_hash() {
|
|||
|
||||
file=$1
|
||||
file_size=${2:-1}
|
||||
if (( file_size != -1 ))
|
||||
then
|
||||
if [ -f "$file" ]
|
||||
then
|
||||
if (( file_size > 0 ))
|
||||
then
|
||||
if (( file_size > 2000000 ))
|
||||
then
|
||||
if ((file_size != -1)); then
|
||||
if [[ -f "$file" ]]; then
|
||||
if ((file_size > 0)); then
|
||||
if ((file_size > 2000000)); then
|
||||
#calculate
|
||||
local tmp_file
|
||||
tmp_file=mktemp
|
||||
|
@ -140,8 +136,7 @@ get_file_size() {
|
|||
fi
|
||||
local file
|
||||
file=$1
|
||||
if [ -f "$file" ]
|
||||
then
|
||||
if [[ -f "$file" ]]; then
|
||||
wc -c <"$file"
|
||||
return
|
||||
fi
|
||||
|
@ -196,7 +191,6 @@ function main() {
|
|||
# create it
|
||||
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}/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!"
|
||||
|
||||
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"
|
||||
insert_media "$folder/titles/logo_amis.png" "logo"
|
Loading…
Add table
Add a link
Reference in a new issue