diff --git a/scripts/features.js b/scripts/features.js index 6c182ca..4478e37 100644 --- a/scripts/features.js +++ b/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 }