From 964cbfe3a05b7b9a4ba98abcc97705db6e5328e2 Mon Sep 17 00:00:00 2001 From: Sy Le Date: Thu, 16 Nov 2023 07:40:55 -0800 Subject: [PATCH] added the headers and prepare the bash content up front --- software/scripts/bash-syle-content.js | 44 ++++++++++++++++----------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/software/scripts/bash-syle-content.js b/software/scripts/bash-syle-content.js index 190f47b7..40c20b13 100644 --- a/software/scripts/bash-syle-content.js +++ b/software/scripts/bash-syle-content.js @@ -2,35 +2,45 @@ async function doWork() { console.log(' >> Setting up .bash_syle'); let res = readText(BASE_BASH_SYLE); + res += `\n\n\n`; - const contentBaseBashScript = await fetchUrlAsString(`bash-profile-barebone.sh`); + let contentBashProfileBarebone = await fetchUrlAsString(`bash-profile-barebone.sh`); + let contentBashProfileAdvanced = await fetchUrlAsString(`bash-profile-more-advanced.sh`); - const contentCommonAliasScript = await fetchUrlAsString(`bash-profile-more-advanced.sh`); + // add the header + contentBashProfileBarebone = ` +########################################################## +## begin barebone profile +########################################################## - res += `\n\n\n`; +${contentBashProfileBarebone} - // barebone script - console.log(' >> Barebone profile'); - res += ` ########################################################## -## barebone profile +## end barebone profile ########################################################## - -${contentBaseBashScript} `.trim(); - // append more advanced script only for fancier OS - console.log(' >> More advanced profile'); - if (is_os_window || is_os_darwin_mac) { - console.log(' >> Installed only for more advanced OS'); + contentBashProfileAdvanced= ` +########################################################## +## begin advanced profile +########################################################## + +${contentBashProfileAdvanced} - res += ` ########################################################## -## more advanced profile +## begin advanced profile ########################################################## + `.trim() -${contentCommonAliasScript} - `.trim(); + // barebone script + console.log(' >> Barebone profile'); + res += contentBashProfileBarebone.trim(); + + // append more advanced script only for fancier OS + console.log(' >> More advanced profile'); + if (is_os_window || is_os_darwin_mac) { + console.log(' >> Installed only for more advanced OS'); + res += contentBashProfileAdvanced.trim(); } else { console.log(consoleLogColor1(' >> Skipped : Only Mac or Windows')); }