Remove difftastic from tooling installation and cache
This commit is contained in:
parent
4f913b6091
commit
ca7af3d671
14
src/vm.ts
14
src/vm.ts
|
|
@ -67,17 +67,17 @@ const CACHE_DIR = join(homedir(), '.sandlot', '.cache')
|
|||
|
||||
/** Check whether the package cache is populated. */
|
||||
async function hasCachedTooling(): Promise<boolean> {
|
||||
const files = ['bun', 'claude', 'neofetch', 'difft', 'nvim.tar.gz']
|
||||
const files = ['bun', 'claude', 'neofetch', 'nvim.tar.gz']
|
||||
const checks = await Promise.all(files.map(f => Bun.file(join(CACHE_DIR, f)).exists()))
|
||||
return checks.every(Boolean)
|
||||
}
|
||||
|
||||
/** Install Bun, Claude Code, neofetch, and Neovim, using cached binaries when available. */
|
||||
/** Install Bun, Claude Code, neofetch, and Neovim using cached binaries when available. */
|
||||
async function installTooling(cached: boolean, log?: (msg: string) => void): Promise<void> {
|
||||
if (cached) {
|
||||
log?.("Installing packages (cached)")
|
||||
await run(
|
||||
$`container exec --user ${USER} ${CONTAINER_NAME} bash -c ${"mkdir -p ~/.local/bin && cp /sandlot/.cache/bun /sandlot/.cache/claude /sandlot/.cache/neofetch /sandlot/.cache/difft ~/.local/bin/ && chmod +x ~/.local/bin/bun ~/.local/bin/claude ~/.local/bin/neofetch ~/.local/bin/difft && ln -sf bun ~/.local/bin/bunx && tar xzf /sandlot/.cache/nvim.tar.gz -C ~/.local --strip-components=1"}`,
|
||||
$`container exec --user ${USER} ${CONTAINER_NAME} bash -c ${"mkdir -p ~/.local/bin && cp /sandlot/.cache/bun /sandlot/.cache/claude /sandlot/.cache/neofetch ~/.local/bin/ && chmod +x ~/.local/bin/bun ~/.local/bin/claude ~/.local/bin/neofetch && ln -sf bun ~/.local/bin/bunx && tar xzf /sandlot/.cache/nvim.tar.gz -C ~/.local --strip-components=1"}`,
|
||||
"Install from cache")
|
||||
return
|
||||
}
|
||||
|
|
@ -97,19 +97,13 @@ async function installTooling(cached: boolean, log?: (msg: string) => void): Pro
|
|||
$`container exec --user ${USER} ${CONTAINER_NAME} bash -c ${"curl -fsSL https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch -o ~/.local/bin/neofetch && chmod +x ~/.local/bin/neofetch"}`,
|
||||
"neofetch installation")
|
||||
|
||||
log?.("Installing difftastic")
|
||||
await $`mkdir -p ${CACHE_DIR}`.quiet()
|
||||
await run(
|
||||
$`container exec --user ${USER} ${CONTAINER_NAME} bash -c ${"curl -fsSL https://github.com/Wilfred/difftastic/releases/latest/download/difft-aarch64-unknown-linux-gnu.tar.gz | tar xz -C ~/.local/bin"}`,
|
||||
"difftastic installation")
|
||||
|
||||
log?.("Installing Neovim")
|
||||
await run(
|
||||
$`container exec --user ${USER} ${CONTAINER_NAME} bash -c ${"curl -fsSL https://github.com/neovim/neovim/releases/latest/download/nvim-linux-arm64.tar.gz -o /sandlot/.cache/nvim.tar.gz && tar xzf /sandlot/.cache/nvim.tar.gz -C ~/.local --strip-components=1"}`,
|
||||
"Neovim installation")
|
||||
|
||||
// Cache binaries for next time
|
||||
await $`container exec --user ${USER} ${CONTAINER_NAME} bash -c ${"cp ~/.local/bin/bun ~/.local/bin/claude ~/.local/bin/neofetch ~/.local/bin/difft /sandlot/.cache/"}`.nothrow().quiet()
|
||||
await $`container exec --user ${USER} ${CONTAINER_NAME} bash -c ${"cp ~/.local/bin/bun ~/.local/bin/claude ~/.local/bin/neofetch /sandlot/.cache/"}`.nothrow().quiet()
|
||||
}
|
||||
|
||||
/** Configure git identity, API key helper, activity hook, and Claude settings. */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user