This commit is contained in:
2024-11-14 16:11:00 -05:00
parent b4a8dd848a
commit 1af25d6c61
7 changed files with 199 additions and 62 deletions
+2 -2
View File
@@ -2,8 +2,8 @@
autoload -U compinit autoload -U compinit
compinit compinit
if [[ -e "$JJ_SOURCE_DIR/~~tmp/shEnvs.sh" ]]; then if [[ -e "$JJ_DATA_DIR/~~tmp/shEnvs.sh" ]]; then
source $JJ_SOURCE_DIR/~~tmp/shEnvs.sh source $JJ_DATA_DIR/~~tmp/shEnvs.sh
fi fi
+17 -17
View File
@@ -17,8 +17,8 @@ fi
if ! hash asdf || \ if ! hash asdf || \
[[ ! -e $JJ_SOURCE_DIR/~~tmp/deps/asdf-tools-installed ]] \ [[ ! -e $JJ_DATA_DIR/~~tmp/deps/asdf-tools-installed ]] \
|| jjIsFileNewerFile "$ASDF_DEFAULT_TOOL_VERSIONS_FILENAME" "$JJ_SOURCE_DIR/~~tmp/deps/asdf-tools-installed" ; then || jjIsFileNewerFile "$ASDF_DEFAULT_TOOL_VERSIONS_FILENAME" "$JJ_DATA_DIR/~~tmp/deps/asdf-tools-installed" ; then
rm -rf $ASDF_DIR rm -rf $ASDF_DIR
git -c advice.detachedHead=false clone -q https://github.com/asdf-vm/asdf.git $ASDF_DIR --branch $ASDF_VERSION git -c advice.detachedHead=false clone -q https://github.com/asdf-vm/asdf.git $ASDF_DIR --branch $ASDF_VERSION
@@ -39,9 +39,9 @@ if ! hash asdf || \
done <${ASDF_DEFAULT_TOOL_VERSIONS_FILENAME} done <${ASDF_DEFAULT_TOOL_VERSIONS_FILENAME}
asdf install asdf install
set -e set -e
rm -rf $JJ_SOURCE_DIR/~~tmp/deps rm -rf $JJ_DATA_DIR/~~tmp/deps
mkdir -p "$JJ_SOURCE_DIR/~~tmp/deps" mkdir -p "$JJ_DATA_DIR/~~tmp/deps"
touch $JJ_SOURCE_DIR/~~tmp/deps/asdf-tools-installed touch $JJ_DATA_DIR/~~tmp/deps/asdf-tools-installed
jjCliLog jjLogSuccess "Asdf and tools installed" jjCliLog jjLogSuccess "Asdf and tools installed"
fi fi
@@ -50,41 +50,41 @@ if [[ -e $ASDF_DIR/asdf.sh ]]; then
fi fi
if [[ ! -e $JJ_SOURCE_DIR/~~tmp/deps/bun-packages-installed ]] \ if [[ ! -e $JJ_DATA_DIR/~~tmp/deps/bun-packages-installed ]] \
|| jjIsFileNewerFile "$JJ_WORKSPACE_DIR/package.json" "$JJ_SOURCE_DIR/~~tmp/deps/bun-packages-installed" \ || jjIsFileNewerFile "$JJ_WORKSPACE_DIR/package.json" "$JJ_DATA_DIR/~~tmp/deps/bun-packages-installed" \
|| jjIsFileNewerFile "$JJ_WORKSPACE_DIR/bun.lockb" "$JJ_SOURCE_DIR/~~tmp/deps/bun-packages-installed" \ || jjIsFileNewerFile "$JJ_WORKSPACE_DIR/bun.lockb" "$JJ_DATA_DIR/~~tmp/deps/bun-packages-installed" \
; then ; then
pushd $JJ_WORKSPACE_DIR > /dev/null pushd $JJ_WORKSPACE_DIR > /dev/null
bun install bun install
popd > /dev/null popd > /dev/null
touch $JJ_SOURCE_DIR/~~tmp/deps/bun-packages-installed touch $JJ_DATA_DIR/~~tmp/deps/bun-packages-installed
jjCliLog jjLogSuccess "Bun dependencies successfully installed" jjCliLog jjLogSuccess "Bun dependencies successfully installed"
fi fi
if [[ ! -e $JJ_SOURCE_DIR/~~tmp/deps/python-packages-installed ]] \ if [[ ! -e $JJ_DATA_DIR/~~tmp/deps/python-packages-installed ]] \
|| jjIsFileNewerFile "$JJ_WORKSPACE_DIR/requirements.txt" "$JJ_SOURCE_DIR/~~tmp/deps/python-packages-installed" \ || jjIsFileNewerFile "$JJ_WORKSPACE_DIR/requirements.txt" "$JJ_DATA_DIR/~~tmp/deps/python-packages-installed" \
; then ; then
pushd $JJ_WORKSPACE_DIR > /dev/null pushd $JJ_WORKSPACE_DIR > /dev/null
pip install -r requirements.txt || pip3 install -r requirements.txt pip install -r requirements.txt || pip3 install -r requirements.txt
popd > /dev/null popd > /dev/null
touch $JJ_SOURCE_DIR/~~tmp/deps/python-packages-installed touch $JJ_DATA_DIR/~~tmp/deps/python-packages-installed
jjCliLog jjLogSuccess "Python dependencies successfully installed" jjCliLog jjLogSuccess "Python dependencies successfully installed"
fi fi
if [[ ! -e $JJ_SOURCE_DIR/~~tmp/deps/npmGlobalDependencies-installed ]] \ if [[ ! -e $JJ_DATA_DIR/~~tmp/deps/npmGlobalDependencies-installed ]] \
|| jjIsFileNewerFile "$JJ_SOURCE_DIR/~~tmp/npmGlobalDependencies.txt" "$JJ_SOURCE_DIR/~~tmp/deps/npmGlobalDependencies-installed" \ || jjIsFileNewerFile "$JJ_DATA_DIR/~~tmp/npmGlobalDependencies.txt" "$JJ_DATA_DIR/~~tmp/deps/npmGlobalDependencies-installed" \
; then ; then
pushd $JJ_WORKSPACE_DIR > /dev/null pushd $JJ_WORKSPACE_DIR > /dev/null
eval "npm i -g $BUN_GLOBAL_DEPENDENCIES" eval "npm i -g $BUN_GLOBAL_DEPENDENCIES"
popd > /dev/null popd > /dev/null
touch $JJ_SOURCE_DIR/~~tmp/deps/npmGlobalDependencies-installed touch $JJ_DATA_DIR/~~tmp/deps/npmGlobalDependencies-installed
jjCliLog jjLogSuccess "Global dependencies successfully installed" jjCliLog jjLogSuccess "Global dependencies successfully installed"
fi fi
if [[ ! -e $JJ_SOURCE_DIR/~~tmp/deps/libpq-installed ]]; then if [[ ! -e $JJ_DATA_DIR/~~tmp/deps/libpq-installed ]]; then
if [[ ${UNAME} == "Linux" ]]; then if [[ ${UNAME} == "Linux" ]]; then
eval "$PACKAGE_MANAGER_INSTALL libpq-dev g++ make" eval "$PACKAGE_MANAGER_INSTALL libpq-dev g++ make"
else else
@@ -92,7 +92,7 @@ if [[ ! -e $JJ_SOURCE_DIR/~~tmp/deps/libpq-installed ]]; then
eval "$PACKAGE_MANAGER_INSTALL postgresql@14" eval "$PACKAGE_MANAGER_INSTALL postgresql@14"
fi fi
touch $JJ_SOURCE_DIR/~~tmp/deps/libpq-installed touch $JJ_DATA_DIR/~~tmp/deps/libpq-installed
fi fi
if [[ ! -d "$JJ_GIT_METADATA_DIR" ]]; then if [[ ! -d "$JJ_GIT_METADATA_DIR" ]]; then
+1 -1
View File
@@ -2,7 +2,7 @@ import fs from 'fs-extra';
import _ from 'lodash'; import _ from 'lodash';
const rawConfigData = fs.readFileSync(`${process.env.JJ_SOURCE_DIR}/~~tmp/jjConfigs.json`, 'utf8'); const rawConfigData = fs.readFileSync(`${process.env.JJ_DATA_DIR}/~~tmp/jjConfigs.json`, 'utf8');
export const jjConfigsExp = JSON.parse(rawConfigData) export const jjConfigsExp = JSON.parse(rawConfigData)
+145 -13
View File
@@ -8,6 +8,7 @@ import { _ } from "lodash";
import { jjLog, jjLogAction, jjLogError } from "./jjLogger"; import { jjLog, jjLogAction, jjLogError } from "./jjLogger";
import { saveFileIfItChanged } from "./saveFileIfItChanged"; import { saveFileIfItChanged } from "./saveFileIfItChanged";
import { gitUserEmail, gitUserName, jjUserName } from "./userUtils"; import { gitUserEmail, gitUserName, jjUserName } from "./userUtils";
import chalk from "chalk";
export const jjConfigs: any = { export const jjConfigs: any = {
processEnvs: {} processEnvs: {}
@@ -20,18 +21,49 @@ export const jjEnsure = async ({
returnProcessEnvs = false returnProcessEnvs = false
}) => { }) => {
// return // return
jjConfigs.modulePath = path.resolve(__dirname, "../") jjConfigs.JJ_SOURCE_DIR = process.env.JJ_SOURCE_DIR
jjConfigs.tmpDir = `${jjConfigs.modulePath}/~~tmp` jjConfigs.JJ_DATA_DIR = process.env.JJ_DATA_DIR
jjConfigs.configSaveFilePath = `${jjConfigs.tmpDir}/configSaveFilePath.txt` jjConfigs.JJ_TMP_DIR = `${jjConfigs.JJ_DATA_DIR}/~~tmp`
jjConfigs.JJ_DEPS_DIR = `${jjConfigs.JJ_DATA_DIR}/~~tmp/deps`
jjConfigs.configSaveFilePath = `${jjConfigs.JJ_TMP_DIR}/configSaveFilePath.txt`
jjConfigs.workspacesFilePath = `${jjConfigs.JJ_TMP_DIR}/workspacesFilePath.json`
if (!fs.existsSync(jjConfigs.tmpDir)) { if (!fs.existsSync(jjConfigs.JJ_TMP_DIR)) {
jjLog(`tmp folder ${jjConfigs.tmpDir} is not exist creating`) jjLog(`tmp folder ${jjConfigs.JJ_TMP_DIR} is not exist creating`)
fs.mkdirSync(jjConfigs.tmpDir, { recursive: true }) fs.mkdirSync(jjConfigs.JJ_TMP_DIR, { recursive: true })
} }
if (!fs.existsSync(jjConfigs.workspacesFilePath)) {
await fs.writeFile(jjConfigs.workspacesFilePath, JSON.stringify([], null, 4), "utf8")
}
jjConfigs.workspaces = JSON.parse((await fs.readFile(jjConfigs.workspacesFilePath, "utf8")))
if (!fs.existsSync(jjConfigs.configSaveFilePath)) { if (!fs.existsSync(jjConfigs.configSaveFilePath)) {
jjLogAction(`JJ cli require jj.yaml path please add it here in absolute way`) console.log(chalk.yellow.bold(`JJ cli require jj.yaml absolute`))
if (jjConfigs.workspaces.length > 0) {
console.log(chalk.magenta.bold(`please select following options:`))
jjConfigs.workspaces.forEach((jjYamlPath, index) => {
console.log(chalk.magenta.bold(`${index + 1} ${jjYamlPath}`))
})
console.log(chalk.magenta.bold(`${jjConfigs.workspaces.length + 1} new workspace`))
const optionSelect: any = await inquirer.prompt([
{
type: 'input',
name: 'optionSelect',
message: '',
},
])
if (optionSelect?.optionSelect - 1 != jjConfigs.workspaces.length) {
jjConfigs.jjYamlPath = jjConfigs.workspaces[optionSelect?.optionSelect - 1]
}
}
if (!jjConfigs.jjYamlPath) {
console.log(chalk.magenta.bold(`please add it here in absolute path`))
const answer: any = await inquirer.prompt([ const answer: any = await inquirer.prompt([
{ {
@@ -41,15 +73,22 @@ export const jjEnsure = async ({
}, },
]) ])
jjConfigs.jjYamlPath = answer.jjYamlPath jjConfigs.jjYamlPath = answer.jjYamlPath
}
if (!fs.existsSync(jjConfigs.jjYamlPath)) { if (!fs.existsSync(jjConfigs.jjYamlPath)) {
jjLogError(`can not find ${jjConfigs.jjYamlPath}`) jjLogError(`can not find ${jjConfigs.jjYamlPath}`)
} }
const jjYamlRawContent = await fs.readFile(jjConfigs.jjYamlPath, "utf8") const jjYamlRawContent = await fs.readFile(jjConfigs.jjYamlPath, "utf8")
const jjYamlObj: any = YAML.load(jjYamlRawContent) const jjYamlObj: any = YAML.load(jjYamlRawContent)
if (_.isEmpty(jjYamlObj?.environments || {})) { if (_.isEmpty(jjYamlObj?.environments || {})) {
jjLogError(`Wrong ${jjConfigs.jjYamlPath} file`) jjLogError(`Wrong ${jjConfigs.jjYamlPath} file`)
} }
jjConfigs.workspaces = [... new Set([...jjConfigs.workspaces, jjConfigs.jjYamlPath])]
await fs.writeFile(jjConfigs.workspacesFilePath, JSON.stringify(jjConfigs.workspaces, null, 4), "utf8")
jjConfigs.jjWorkSpacePath = path.dirname(jjConfigs.jjYamlPath) jjConfigs.jjWorkSpacePath = path.dirname(jjConfigs.jjYamlPath)
jjConfigs.jjYamlObj = jjYamlObj jjConfigs.jjYamlObj = jjYamlObj
@@ -70,10 +109,13 @@ export const jjEnsure = async ({
jjConfigs.processEnvs.JJ_WORKSPACE_DIR = jjConfigs.jjWorkSpacePath jjConfigs.processEnvs.JJ_WORKSPACE_DIR = jjConfigs.jjWorkSpacePath
jjConfigs.processEnvs.JJ_SOURCE_DIR = jjConfigs.JJ_SOURCE_DIR
jjConfigs.processEnvs.JJ_DATA_DIR = jjConfigs.JJ_DATA_DIR
jjConfigs.JJ_WORKSPACE_DIR = jjConfigs.JJ_WORKSPACE_DIR
jjConfigs.processEnvs.JJ_WORKSPACE_PROJECT_NAME = jjConfigs.jjYamlObj.name jjConfigs.processEnvs.JJ_WORKSPACE_PROJECT_NAME = jjConfigs.jjYamlObj.name
jjConfigs.processEnvs.ASDF_DIR = `${process.env.JJ_SOURCE_DIR}/~~asdf_${jjConfigs.processEnvs.JJ_WORKSPACE_PROJECT_NAME}` jjConfigs.processEnvs.ASDF_DIR = `${process.env.JJ_DATA_DIR}/~~asdf_${jjConfigs.processEnvs.JJ_WORKSPACE_PROJECT_NAME}`
jjConfigs.processEnvs.ASDF_DATA_DIR = `${process.env.JJ_SOURCE_DIR}/~~asdf_${jjConfigs.processEnvs.JJ_WORKSPACE_PROJECT_NAME}` jjConfigs.processEnvs.ASDF_DATA_DIR = `${process.env.JJ_DATA_DIR}/~~asdf_${jjConfigs.processEnvs.JJ_WORKSPACE_PROJECT_NAME}`
jjConfigs.processEnvs.ASDF_DEFAULT_TOOL_VERSIONS_FILENAME = `${jjConfigs.tmpDir}/.tool-versions` jjConfigs.processEnvs.ASDF_DEFAULT_TOOL_VERSIONS_FILENAME = `${jjConfigs.JJ_TMP_DIR}/.tool-versions`
const asdfToolsVersionFileContent = Object.keys(jjConfigs.jjYamlObj.asdf.tools).map(key => `${key} ${jjConfigs.jjYamlObj.asdf.tools[key].version}`).join('\n') const asdfToolsVersionFileContent = Object.keys(jjConfigs.jjYamlObj.asdf.tools).map(key => `${key} ${jjConfigs.jjYamlObj.asdf.tools[key].version}`).join('\n')
@@ -84,7 +126,7 @@ export const jjEnsure = async ({
jjConfigs.processEnvs.OS_DEPENDENCIES = jjConfigs.jjYamlObj.osDependencies.join(' ') jjConfigs.processEnvs.OS_DEPENDENCIES = jjConfigs.jjYamlObj.osDependencies.join(' ')
const bunGlobalDependencies = jjConfigs.jjYamlObj.bun.globals.join(' ') const bunGlobalDependencies = jjConfigs.jjYamlObj.bun.globals.join(' ')
saveFileIfItChanged(bunGlobalDependencies, `${jjConfigs.tmpDir}/bunGlobalDependencies.txt`) saveFileIfItChanged(bunGlobalDependencies, `${jjConfigs.JJ_TMP_DIR}/bunGlobalDependencies.txt`)
jjConfigs.processEnvs.BUN_GLOBAL_DEPENDENCIES = bunGlobalDependencies jjConfigs.processEnvs.BUN_GLOBAL_DEPENDENCIES = bunGlobalDependencies
jjConfigs.processEnvs.JJ_GIT_METADATA_DIR = `${jjConfigs.processEnvs.JJ_WORKSPACE_DIR}/${jjConfigs.jjYamlObj.metadataRepo.path}` jjConfigs.processEnvs.JJ_GIT_METADATA_DIR = `${jjConfigs.processEnvs.JJ_WORKSPACE_DIR}/${jjConfigs.jjYamlObj.metadataRepo.path}`
@@ -120,7 +162,97 @@ export const jjEnsure = async ({
jjConfigs.jjYamlPath jjConfigs.jjYamlPath
) )
saveFileIfItChanged(JSON.stringify(jjConfigs, null, 4), `${jjConfigs.tmpDir}/jjConfigs.json`) jjConfigs.jjYamlObj.commands = {
"help": {
"desc": "This help info.",
"mainTitle": "Help",
"postCommand": "",
"maxLength": 12,
"keys": [
{
"key": "auto-completion",
"desc": "auto-completion",
"keys": []
},
{
"key": "workDirs",
"desc": "workDirs",
"keys": []
},
{
"key": "version-source",
"desc": "version-source",
"keys": []
},
{
"key": "version-workspace",
"desc": "version-workspace",
"keys": []
},
{
"key": "change-workspace",
"desc": "change-workspace",
"keys": []
},
{
"key": "clean-workspace",
"desc": "clean-workspace",
"keys": []
}
],
"scriptToRun": {
"prePath": "__JJ_SOURCE_DIR__",
"path": "cli/help.ts"
}
},
"secrets": {
"desc": "Secrets",
"mainTitle": "Secrets",
"postCommand": "",
"maxLength": 12,
"keys": [
{
"key": "setSecret",
"desc": "Set a secret to the given file",
"postCommand": " file key val",
"maxLength": 50,
"keys": [],
"postCommandsForce": []
},
{
"key": "setSecretFromFile",
"desc": "Set a secret to the given file",
"postCommand": " file key absFile",
"maxLength": 50,
"keys": [],
"postCommandsForce": []
},
{
"key": "decryptFile",
"desc": "decrypt file",
"postCommand": " file",
"maxLength": 50,
"keys": [],
"postCommandsForce": []
},
{
"key": "commitSecretMeta",
"desc": "",
"postCommand": "",
"maxLength": 50,
"keys": [],
"postCommandsForce": []
}
],
"scriptToRun": {
"prePath": "__JJ_SOURCE_DIR__",
"path": "cli/secrets.ts"
}
},
...jjConfigs.jjYamlObj.commands
}
saveFileIfItChanged(JSON.stringify(jjConfigs, null, 4), `${jjConfigs.JJ_TMP_DIR}/jjConfigs.json`)
if (returnProcessEnvs) { if (returnProcessEnvs) {
@@ -133,7 +265,7 @@ export const jjEnsure = async ({
console.log(command) console.log(command)
}) })
fs.writeFileSync(`${jjConfigs.tmpDir}/shEnvs.sh`, shEnvs, 'utf-8'); fs.writeFileSync(`${jjConfigs.JJ_TMP_DIR}/shEnvs.sh`, shEnvs, 'utf-8');
} }
+1 -1
View File
@@ -11,7 +11,7 @@ export const jjLoggerObj = {}
const __filename = fileURLToPath(import.meta.url); const __filename = fileURLToPath(import.meta.url);
const logFilePath = `${process.env.JJ_SOURCE_DIR}/~~tmp/jj.log`; const logFilePath = `${process.env.JJ_DATA_DIR}/~~tmp/jj.log`;
jjLoggerObj['logFilePath'] = logFilePath jjLoggerObj['logFilePath'] = logFilePath
+24 -19
View File
@@ -19,6 +19,10 @@ trap '[[ "$?" == "1" ]] && echo -e "\033[1;31m[jj] ERROR !\033[0m" >&2' EXIT
# compinit # compinit
export JJ_DATA_DIR="$HOME/.jjDataDir"
mkdir -p $JJ_DATA_DIR
jjCpmmandRunPoint=$(echo ${BASH_SOURCE[0]}) jjCpmmandRunPoint=$(echo ${BASH_SOURCE[0]})
@@ -44,10 +48,15 @@ export JJ_SOURCE_DIR=$(findJJSource)
if [[ "$1" == "--clean" ]]; then
rm -rf $JJ_SOURCE_DIR/~~tmp/deps
fi
if [[ "$1" == "help" ]]; then
if [[ "$2" == "change-workspace" ]]; then
rm -rf $JJ_DATA_DIR/~~tmp/configSaveFilePath.txt
fi
if [[ "$2" == "clean-workspace" ]]; then
rm -rf $JJ_DATA_DIR/~~tmp/deps
fi
fi
if [[ -e ~/.bun/bin/bun ]]; then if [[ -e ~/.bun/bin/bun ]]; then
@@ -62,7 +71,7 @@ if [[ "$__currentBunVersion" != "${__bunVersionExpect}" ]]; then
export PATH="~/.bun/bin:${PATH}" export PATH="~/.bun/bin:${PATH}"
fi fi
mkdir -p "$JJ_SOURCE_DIR/~~tmp/deps" mkdir -p "$JJ_DATA_DIR/~~tmp/deps"
alias jj="$JJ_SOURCE_DIR/jj.sh" alias jj="$JJ_SOURCE_DIR/jj.sh"
@@ -70,34 +79,30 @@ source "$JJ_SOURCE_DIR/bashUtils/index.sh"
if [[ ! -e "$JJ_SOURCE_DIR/~~tmp/configSaveFilePath.txt" ]]; then if [[ ! -e "$JJ_DATA_DIR/~~tmp/configSaveFilePath.txt" ]]; then
$JJ_SOURCE_DIR/helpers/jjEnsure.ts init $JJ_SOURCE_DIR/helpers/jjEnsure.ts init
fi fi
# $JJ_SOURCE_DIR/helpers/jjEnsure.ts returnProcessEnvs $JJ_SOURCE_DIR/helpers/jjEnsure.ts init
# exit 0
if [[ ! -e "$JJ_SOURCE_DIR/~~tmp/configSaveFilePath.txt" ]]; then
$JJ_SOURCE_DIR/helpers/jjEnsure.ts init
fi
if [[ -e "$JJ_SOURCE_DIR/~~tmp/shEnvs.sh" ]]; then if [[ -e "$JJ_DATA_DIR/~~tmp/shEnvs.sh" ]]; then
source $JJ_SOURCE_DIR/~~tmp/shEnvs.sh source $JJ_DATA_DIR/~~tmp/shEnvs.sh
fi fi
if [[ ! -e "$JJ_SOURCE_DIR/~~tmp/shEnvs.sh" ]] \ if [[ ! -e "$JJ_DATA_DIR/~~tmp/shEnvs.sh" ]] \
|| [[ -z $JJ_WORKSPACE_DIR ]] \ || [[ -z $JJ_WORKSPACE_DIR ]] \
|| jjIsFileNewerFile "$JJ_WORKSPACE_DIR/jj.yaml" "$JJ_SOURCE_DIR/~~tmp/shEnvs.sh" \ || jjIsFileNewerFile "$JJ_WORKSPACE_DIR/jj.yaml" "$JJ_DATA_DIR/~~tmp/shEnvs.sh" \
|| jjIsFileNewerFile "$JJ_SOURCE_DIR/~~tmp/jjConfigs.json" "$JJ_SOURCE_DIR/~~tmp/shEnvs.sh" \ || jjIsFileNewerFile "$JJ_DATA_DIR/~~tmp/jjConfigs.json" "$JJ_DATA_DIR/~~tmp/shEnvs.sh" \
|| jjIsFileNewerFile "$JJ_SOURCE_DIR/package.json" "$JJ_SOURCE_DIR/~~tmp/shEnvs.sh" \ || jjIsFileNewerFile "$JJ_SOURCE_DIR/package.json" "$JJ_DATA_DIR/~~tmp/shEnvs.sh" \
|| jjIsFileNewerFile "$JJ_WORKSPACE_DIR/package.json" "$JJ_SOURCE_DIR/~~tmp/shEnvs.sh" \ || jjIsFileNewerFile "$JJ_WORKSPACE_DIR/package.json" "$JJ_DATA_DIR/~~tmp/shEnvs.sh" \
; then ; then
MILLISECONDS=$(get_milliseconds) ; echo "returnProcessEnvs 01 $MILLISECONDS" MILLISECONDS=$(get_milliseconds) ; echo "returnProcessEnvs 01 $MILLISECONDS"
eval $($JJ_SOURCE_DIR/helpers/jjEnsure.ts returnProcessEnvs) eval $($JJ_SOURCE_DIR/helpers/jjEnsure.ts returnProcessEnvs)
MILLISECONDS=$(get_milliseconds) ; echo "returnProcessEnvs 02 $MILLISECONDS" MILLISECONDS=$(get_milliseconds) ; echo "returnProcessEnvs 02 $MILLISECONDS"
fi fi
source $JJ_SOURCE_DIR/~~tmp/shEnvs.sh source $JJ_DATA_DIR/~~tmp/shEnvs.sh
export JJ_WORKSPACE_CURRENT_COMMIT=$(cd $JJ_WORKSPACE_DIR ; git rev-parse HEAD) export JJ_WORKSPACE_CURRENT_COMMIT=$(cd $JJ_WORKSPACE_DIR ; git rev-parse HEAD)
export JJ_WORKSPACE_CURRENT_BRANCH=$(cd $JJ_WORKSPACE_DIR ; git rev-parse --abbrev-ref HEAD) export JJ_WORKSPACE_CURRENT_BRANCH=$(cd $JJ_WORKSPACE_DIR ; git rev-parse --abbrev-ref HEAD)
@@ -134,7 +139,7 @@ source "$JJ_SOURCE_DIR/bashUtils/ensureDependency.sh"
# if [[ ! -e $JJ_SOURCE_DIR/~~tmp/pa ]]; then # if [[ ! -e $JJ_DATA_DIR/~~tmp/pa ]]; then
# echo "asdadasd" # echo "asdadasd"
# fi # fi
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "jj-command-line", "name": "jj-command-line",
"description": "jj cli", "description": "jj cli",
"version": "1.0.7", "version": "1.0.8",
"author": "Jason Jafari", "author": "Jason Jafari",
"bin": { "bin": {
"jj": "./jj.sh" "jj": "./jj.sh"