Browse Source

improved self update feature

main
deicidus 2 years ago
parent
commit
81a1a15e5e
  1. 7
      scripts/features.js

7
scripts/features.js

@ -2,6 +2,11 @@
import { execSync, exec } from 'child_process'
import { AO_MANUAL_PATH } from './manual.js'
import { loadJsonFile } from './files.js'
import path from 'path'
import { fileURLToPath } from 'url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
// Adds a line to .bashrc to make 'ao' an alias for 'ao-cli', to simplify using the AO from the command line
export function installAoAlias() {
@ -15,7 +20,7 @@ export function installAoAlias() {
}
export async function getAoCliVersion() {
const packageJson = await loadJsonFile('./package.json')
const packageJson = await loadJsonFile(path.join(__dirname, '../package.json'))
return packageJson.version
}

Loading…
Cancel
Save