From 410eff03e5621fa70a81d16a1980d9606fa89633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Mon, 5 Feb 2024 16:03:31 +0100 Subject: [PATCH] _cd_to_site: Remove function as 'cd' doesn't work in scripts --- qsgen2 | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/qsgen2 b/qsgen2 index 8e949e0..4f9d4f4 100755 --- a/qsgen2 +++ b/qsgen2 @@ -85,35 +85,6 @@ _list_sites() { fi } -_cd_to_site() { - local site_number="${1}" - local sites_file="${HOME}/.config/qsgen2/sites.qsc" - - # Check if sites file exists - if [[ ! -f "${sites_file}" ]]; then - echo "Sites file not found." - return 1 # Exit the function with an error status. - fi - - # Get the directory for the site number - local project_dir=$(awk -F'|' -v num="${site_number}" '$1 == num {print $3}' "${sites_file}") - - # Check if the directory was found - if [[ -z "${project_dir}" ]]; then - echo "Site with number ${site_number} not found." - return 1 # Exit the function with an error status. - fi - - # Check if the directory exists - if [[ ! -d "${project_dir}" ]]; then - echo "The directory for site number ${site_number} does not exist." - return 1 # Exit the function with an error status. - fi - - # Print the cd command - echo "cd ${project_dir}" -} - function _version() { echo "${yellow}- Created by kekePower - 2018-$(date +%Y)${end}" @@ -200,10 +171,6 @@ case "$1" in _list_sites exit ;; - cd) - _cd_to_site_output() { eval $(_cd_to_site "$1"); }; _cd_to_site_output $2 - exit - ;; force) _msg sub "- Forced Update: Generating Everything" : >| "$blog_cache_file" # Truncate the blog cache before doing update