Added a function to copy files and folders into the 'output' folder

master
Aadhavan Srinivasan 9 months ago
parent 8c4862cd05
commit 401546e751

@ -1,7 +1,6 @@
#!/bin/bash #!/bin/bash
BASE_PATH="/home/aadhavan/Programming/Bash/sitegen" BASE_PATH=$(dirname "$0")
check_for_dirs() { check_for_dirs() {
if [ ! -d "${BASE_PATH}/source" ]; then if [ ! -d "${BASE_PATH}/source" ]; then
@ -200,6 +199,12 @@ gen_index_page() { # Generate an index page (site map) that includes links to th
} }
copy_things_in() {
cp ${BASE_PATH}/styles.css ${BASE_PATH}/output/
cp ${BASE_PATH}/files ${BASE_PATH}/output/
}
clean_up() { clean_up() {
rm -r ${BASE_PATH}/temp rm -r ${BASE_PATH}/temp
} }
@ -212,5 +217,5 @@ del_files_in_output
md_to_html md_to_html
gen_sorted_file_list # Sets the 'sorted_file_list' variable gen_sorted_file_list # Sets the 'sorted_file_list' variable
gen_index_page "$sorted_file_list" # Uses the 'sorted_file_list' variable gen_index_page "$sorted_file_list" # Uses the 'sorted_file_list' variable
copy_things_in
clean_up clean_up

Loading…
Cancel
Save