Browse Source

updated readme and reduced frequency of fantasy messsages

main
deicidus 3 years ago
parent
commit
7cde163a84
  1. 4
      README.md
  2. 7
      index.js
  3. 4
      scripts/util.js
  4. 7
      scripts/welcome.js

4
README.md

@ -27,7 +27,7 @@ These features work right now:
* `ao-cli` can self-update to the newest version * `ao-cli` can self-update to the newest version
* Run AO unit tests to verify the up-to-spec functioning of the system's running AO API server * Run AO unit tests to verify the up-to-spec functioning of the system's running AO API server
* Easily view installed/running status of optional AO features * Easily view installed/running status of optional AO features
* Add `ao` alias for `ao-cli` (under Features→ao-cli) * Add `ao` alias for `ao-cli` (under `Features→ao-cli`)
* Detects your OS, with support for Debian/Ubuntu, Arch/Manjaro, and Fedora (MacOS planned) * Detects your OS, with support for Debian/Ubuntu, Arch/Manjaro, and Fedora (MacOS planned)
## Upcoming Features ## Upcoming Features
@ -46,6 +46,7 @@ These features are planned and many are mocked up in the menus:
* Full interactive wizard to walk you through setting up and connecting new AO hardware resources to your AO server * Full interactive wizard to walk you through setting up and connecting new AO hardware resources to your AO server
* Terminal spellbook to save and trade your favorite UNIX commands * Terminal spellbook to save and trade your favorite UNIX commands
* AO server using AO features via ao-cli command line switches (with optional sound notifications on server computer) * AO server using AO features via ao-cli command line switches (with optional sound notifications on server computer)
* Enchant your 'cd' command to narrate your travels through the UNIX filesystem (under `Features→ao-cli`) (less annoying than it sounds, easy to disable)
## Important Locations ## Important Locations
@ -60,6 +61,7 @@ These features are planned and many are mocked up in the menus:
## Version History ## Version History
* 0.1.3 Added fantasy hook feature to bring the AO MUD aesthetic into the terminal
* 0.1.2 Improved install wizard * 0.1.2 Improved install wizard
* 0.1.1 AO install wizard partway done, reorganized project repos, 'Check AO install' feature works * 0.1.1 AO install wizard partway done, reorganized project repos, 'Check AO install' feature works
* 0.1.0 View, create or recall, upboat and downboat priorities; partial AO install wizard * 0.1.0 View, create or recall, upboat and downboat priorities; partial AO install wizard

7
index.js

@ -13,7 +13,7 @@ import useAoMenu from './scripts/ao.js'
import aoInstallWizard, { chooseAoVersion, checkAo } from './scripts/wizard.js' import aoInstallWizard, { chooseAoVersion, checkAo } from './scripts/wizard.js'
import testsMenu from './scripts/tests.js' import testsMenu from './scripts/tests.js'
import { headerStyle } from './scripts/styles.js' import { headerStyle } from './scripts/styles.js'
import { sleep } from './scripts/util.js' import { sleep, randomInt } from './scripts/util.js'
import './scripts/strings.js' import './scripts/strings.js'
// Import AO modular features // Import AO modular features
@ -161,7 +161,10 @@ async function handleArgs(args) {
return false return false
case '--interstitial': case '--interstitial':
case '-cd': case '-cd':
console.log(wander(args[1])) // Don't say a message every time or it will annoy everybody
if(randomInt(0, 6) === 0) {
console.log(wander(args[1]))
}
return false return false
} }
return true return true

4
scripts/util.js

@ -1,7 +1,7 @@
// General helper functions // General helper functions
// Returns a random int between min and max (inclusive) // Returns a random int between min and max (inclusive)
function randomInt(min, max) { export function randomInt(min, max) {
min = Math.ceil(min); min = Math.ceil(min);
max = Math.floor(max); max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min; return Math.floor(Math.random() * (max - min + 1)) + min;
@ -17,4 +17,4 @@ export function sleep(ms = 550) {
return new Promise((r) => setTimeout(r, ms)) return new Promise((r) => setTimeout(r, ms))
} }
export const isObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]' export const isObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]'

7
scripts/welcome.js

@ -98,10 +98,6 @@ export function farewell() {
console.log(chalk.yellow.bold(selectRandom(farewellMessages))) console.log(chalk.yellow.bold(selectRandom(farewellMessages)))
} }
export function wander() {
//console.lo(selectRa))
}
// Asks the given yes or no answer returns true or false for their response // Asks the given yes or no answer returns true or false for their response
export async function yesOrNo(prompt = 'Yes or no?', defaultAnswer = true) { export async function yesOrNo(prompt = 'Yes or no?', defaultAnswer = true) {
const answer = await inquirer.prompt({ const answer = await inquirer.prompt({
@ -123,5 +119,4 @@ export async function askQuestionText(prompt = 'Please enter a string:', promptO
Object.assign(options, promptOptions) Object.assign(options, promptOptions)
const answer = await inquirer.prompt(options) const answer = await inquirer.prompt(options)
return answer.text return answer.text
} }
Loading…
Cancel
Save