import { $ } from "bun"
import { resolve, join } from "path"
import { untilde } from "./utils"

export const NOSE_ICON = ` ͡° ͜ʖ ͡°`

export const NOSE_BIN = resolve("./bin")
export const NOSE_DATA = resolve("./data")

export const NOSE_DIR = resolve(untilde(process.env.NOSE_DIR || "./nose"))
export const DEFAULT_PROJECT = "root"
export const NOSE_ROOT_BIN = join(NOSE_DIR, DEFAULT_PROJECT, "bin")

export const NOSE_STARTED = Date.now()

export const GIT_SHA = (await $`git rev-parse --short HEAD`.text()).trim()
    ; (globalThis as any).GIT_SHA = GIT_SHA