|
|
|
@ -6,16 +6,16 @@ import { detectOS, updateSoftware, installRequired, setNodeVersion } from './scr
|
|
|
|
|
import { checkAoEnvFile, aoEnv, setAoEnv, AO_ENV_FILE_PATH } from './scripts/settings.js' |
|
|
|
|
import { unicornPortal, asciiArt, clearScreen, spinnerWait } from './scripts/console.js' |
|
|
|
|
import { welcome, exclaim, roger, farewell } from './scripts/welcome.js' |
|
|
|
|
import { printManualPage, manualFolderAsMenu } from './scripts/manual.js' |
|
|
|
|
import { printManualPage, manualFolderAsMenu, AO_MANUAL_PATH } from './scripts/manual.js' |
|
|
|
|
import { isFolder } from './scripts/files.js' |
|
|
|
|
import { sleep } from './scripts/util.js' |
|
|
|
|
import { tests } from './scripts/tests.js' |
|
|
|
|
import { headerStyle } from './scripts/chalkStyles.js' |
|
|
|
|
import './scripts/strings.js' |
|
|
|
|
import { installAoAlias } from './scripts/features.js' |
|
|
|
|
import { installAoAlias, downloadManual, updateManual } from './scripts/features.js' |
|
|
|
|
import { startPublicBootstrap } from './scripts/bootstrap.js' |
|
|
|
|
|
|
|
|
|
// These should become .env variables that are loaded intelligently
|
|
|
|
|
const MANUAL_PATH = process.env.HOME + '/.ao/manual' |
|
|
|
|
let distro |
|
|
|
|
let memberName |
|
|
|
|
|
|
|
|
@ -66,10 +66,21 @@ async function mainMenu() {
|
|
|
|
|
while(await testsMenu()) {} |
|
|
|
|
break |
|
|
|
|
case 'Manual': |
|
|
|
|
await printManualPage(MANUAL_PATH) // Fencepost case - print overview page
|
|
|
|
|
if(!isFolder(AO_MANUAL_PATH)) { |
|
|
|
|
console.log("Downloading the AO manual...") |
|
|
|
|
if(downloadManual()) { |
|
|
|
|
console.log("Downloaded the AO Manual from the official git repo via http and saved to", AO_MANUAL_PATH + '.') |
|
|
|
|
} else { |
|
|
|
|
console.log('Failed to download the AO manual, sorry.') |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
updateManual() |
|
|
|
|
} |
|
|
|
|
await printManualPage(AO_MANUAL_PATH) // Fencepost case - print overview page
|
|
|
|
|
let previousChoice = 0 |
|
|
|
|
do { |
|
|
|
|
previousChoice = await manualFolderAsMenu(MANUAL_PATH, 'AO User Manual', 'Back to Main Menu', previousChoice + 1) |
|
|
|
|
previousChoice = await manualFolderAsMenu(AO_MANUAL_PATH, 'AO User Manual', 'Back to Main Menu', previousChoice + 1) |
|
|
|
|
} while(previousChoice !== false) |
|
|
|
|
break |
|
|
|
|
case 'Log Out': |
|
|
|
|