Skip to content

Commit

Permalink
added the headers and prepare the bash content up front
Browse files Browse the repository at this point in the history
  • Loading branch information
synle committed Nov 16, 2023
1 parent 04693f1 commit 964cbfe
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions software/scripts/bash-syle-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down

0 comments on commit 964cbfe

Please sign in to comment.