diff --git a/helpers/jjCli.ts b/helpers/jjCli.ts new file mode 100755 index 0000000..efb269d --- /dev/null +++ b/helpers/jjCli.ts @@ -0,0 +1,5 @@ +#!/usr/bin/env bun + +import { jjConfigsExp } from "./jjConfigUtils"; + +console.log(jjConfigsExp) \ No newline at end of file diff --git a/helpers/jjCliYargs.ts b/helpers/jjCliYargs.ts index 8fef48c..e5113c0 100755 --- a/helpers/jjCliYargs.ts +++ b/helpers/jjCliYargs.ts @@ -3,10 +3,10 @@ import yargs from "yargs"; import { hideBin } from "yargs/helpers"; import fs from "fs-extra"; +import { jjConfigsExp } from "./jjConfigUtils"; try { - const rawConfigData = fs.readFileSync(`${process.env.JJ_SOURCE_DIR}/~~tmp/jjConfigs.json`, 'utf8'); - const parsedConfig = JSON.parse(rawConfigData); + const parsedConfig = jjConfigsExp; const availableEnvironments = parsedConfig?.jjYamlObj?.environments || {}; const cliArgs = yargs(hideBin(process.argv)).help(false).argv; diff --git a/helpers/jjConfigUtils.ts b/helpers/jjConfigUtils.ts new file mode 100644 index 0000000..0e63169 --- /dev/null +++ b/helpers/jjConfigUtils.ts @@ -0,0 +1,5 @@ +import fs from 'fs-extra'; + +const rawConfigData = fs.readFileSync(`${process.env.JJ_SOURCE_DIR}/~~tmp/jjConfigs.json`, 'utf8'); + +export const jjConfigsExp = JSON.parse(rawConfigData) \ No newline at end of file diff --git a/jj.sh b/jj.sh index 10916f1..4059da3 100755 --- a/jj.sh +++ b/jj.sh @@ -104,6 +104,9 @@ fi # echo "asdadasd" # fi +${JJ_SOURCE_DIR}/helpers/jjCli.ts + +