Skip to content

Commit e385c32

Browse files
committedApr 20, 2022
fix backup original photo v.1.0.8
1 parent 0057436 commit e385c32

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed
 

‎awesomeshot

+14-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# Copyright (c) 2021 - 2022 xShin
77

8-
version=1.0.7
8+
version=1.0.8
99

1010
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-${HOME}/.config}
1111
config_file="${XDG_CONFIG_HOME}/awesomeshot/awesomeshot.conf"
@@ -299,7 +299,7 @@ function autoRun() {
299299
fi
300300

301301
termux-media-scan "${file_name}" &> /dev/null
302-
termux-toast -b "${second_border_color}" -c "${footer_foreground}" -g top "${file_name##*/}"
302+
termux-toast -b "${hex_color[0]}" -c "${hex_color[1]}" -g top "${file_name##*/}"
303303
termux-notification --action "termux-open '${file_name}'" --icon "camera_enhance" \
304304
--image-path "${file_name}" --priority "high" --title "📸 Awesomeshot v${version}"
305305

@@ -315,6 +315,10 @@ function autoRun() {
315315
done
316316
}
317317

318+
function getPwd() {
319+
pwd=$(pwd)
320+
}
321+
318322
function manualRun() {
319323
getUserConfig
320324
header
@@ -324,12 +328,12 @@ function manualRun() {
324328
check
325329

326330
if [ "${convert_to_png}" == "yes" ]; then
327-
convertToPng "${get_file_name}"
331+
convertToPng
328332
fi
329333

330334
if [ "${backup}" == "yes" ]; then
331335
title "${COLOR_SKY}[+] BACKUP IMAGE${COLOR_DEFAULT}"
332-
backupOriginalPhoto "${get_file_name}"
336+
backupOriginalPhoto "${file_name}"
333337
fi
334338

335339
title "${COLOR_SKY}[+] EDITING IMAGE${COLOR_DEFAULT}"
@@ -360,7 +364,7 @@ function manualRun() {
360364
fi
361365

362366
termux-media-scan "${file_name}" &> /dev/null
363-
termux-toast -b "${second_border_color}" -c "${footer_foreground}" -g top "${file_name##*/}"
367+
termux-toast -b "${hex_color[0]}" -c "${hex_color[1]}" -g top "${file_name}"
364368
termux-notification --action "termux-open '${file_name}'" --icon "camera_enhance" \
365369
--image-path "${file_name}" --priority "high" --title "📸 Awesomeshot v${version}"
366370

@@ -377,14 +381,15 @@ function manualRun() {
377381

378382
function backupOriginalPhoto() {
379383
change_filename_backup=$(echo $1 | sed 's/.png/_backup.png/g')
384+
get_filename_suffix=${change_filename_backup##*/}
380385

381386
if [ ! -d ${path_backup} ]; then
382387
mkdir -p "${path_backup}"
383388
fi
384389

385-
cp "${file_name}" "${path_backup}/${change_filename_backup}"
390+
cp "${file_name}" "${path_backup}/${get_filename_suffix}"
386391

387-
if [ -f ${path_backup}/${change_filename_backup} ]; then
392+
if [ -f ${path_backup}/${get_filename_suffix} ]; then
388393

389394
subtitle "[+]*Backup*File*"
390395
check
@@ -701,7 +706,8 @@ case "${1}" in
701706
;;
702707
-m|--manual )
703708
if [ ${2} ]; then
704-
file_name="${2}"
709+
getPwd
710+
file_name="${pwd}/${2}"
705711
main manualRun
706712
else
707713
echo ""

0 commit comments

Comments
 (0)