the universal sandbox runtime for agents and humans. pocketenv.io
sandbox openclaw agent claude-code vercel-sandbox deno-sandbox cloudflare-sandbox atproto sprites daytona
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(init): call unzip command directly

+27 -22
+5
deno.lock
··· 105 105 "https://cdn.jsdelivr.net/gh/bootoffav/deno-zip@main/deps.ts": "79548387594b3ae1efaaa870b5a507c4d6bedede13dbd5d4ad42f6cda0aeef86", 106 106 "https://cdn.jsdelivr.net/gh/bootoffav/deno-zip@main/mod.ts": "28eecbc3e1e5adf564f4aa465e64268713a05653104bacdcb04561533f8caf57", 107 107 "https://cdn.jsdelivr.net/gh/bootoffav/deno-zip@main/utils.ts": "43c323f2b79f9db1976c5739bbb1f9cced20e8077ca7e7e703f9d01d4330bd9d", 108 + "https://cdn.jsdelivr.net/gh/tsirysndr/deno-zip@main/compress.ts": "9f05a70dfa2f113329bff448c00016cf6e30f946c1e286fd2cb36f86d575662f", 109 + "https://cdn.jsdelivr.net/gh/tsirysndr/deno-zip@main/decompress.ts": "c7e6f49dc6fa3d70d9d73cfcdaf0b7deb9bdac90cc11ad89f6098278aacadbe9", 110 + "https://cdn.jsdelivr.net/gh/tsirysndr/deno-zip@main/deps.ts": "79548387594b3ae1efaaa870b5a507c4d6bedede13dbd5d4ad42f6cda0aeef86", 111 + "https://cdn.jsdelivr.net/gh/tsirysndr/deno-zip@main/mod.ts": "28eecbc3e1e5adf564f4aa465e64268713a05653104bacdcb04561533f8caf57", 112 + "https://cdn.jsdelivr.net/gh/tsirysndr/deno-zip@main/utils.ts": "43c323f2b79f9db1976c5739bbb1f9cced20e8077ca7e7e703f9d01d4330bd9d", 108 113 "https://cdn.jsdelivr.net/gh/will-weiss/spinners@master/mod.ts": "ed5b3562d4ea6c6887bc7e9844612b08a3bc3a3678ca77cc7dfdf461c362751e", 109 114 "https://cdn.jsdelivr.net/gh/will-weiss/spinners@master/spinner-types.ts": "c67e6962a0c738aa57b4d3ad9fe06c8c0131f93360acbf95456f2ba200fd8826", 110 115 "https://cdn.jsdelivr.net/gh/will-weiss/spinners@master/terminal-spinner.ts": "aa2fcf87060caf79fbd26f741c2d8e0093f196b891aca9ffd0a709aba11a1620",
-1
deps.ts
··· 24 24 SpinnerTypes, 25 25 TerminalSpinner, 26 26 } from "https://cdn.jsdelivr.net/gh/will-weiss/spinners@master/mod.ts"; 27 - export { decompress } from "https://cdn.jsdelivr.net/gh/bootoffav/deno-zip@main/mod.ts"; 28 27 import dir from "https://deno.land/x/dir@1.5.2/mod.ts"; 29 28 export { dir }; 30 29 import Logger from "https://deno.land/x/logger@v1.1.3/logger.ts";
+22 -21
src/cmd/init.ts
··· 1 1 import { 2 + brightGreen, 2 3 cyan, 3 - pkgx, 4 + generateName, 5 + green, 4 6 magenta, 5 - brightGreen, 7 + pkgx, 8 + SpinnerTypes, 6 9 TerminalSpinner, 7 - SpinnerTypes, 8 - green, 9 - decompress, 10 - generateName, 11 10 } from "../../deps.ts"; 12 11 import { POCKETENV_CACHE_DIR } from "../consts.ts"; 13 12 import { existsSync } from "node:fs"; ··· 16 15 17 16 async function init( 18 17 { template, standalone }: { template?: string; standalone?: boolean }, 19 - name?: string 18 + name?: string, 20 19 ) { 21 20 if (!name) { 22 21 console.log(`${cyan("?")} Workspace name: `); ··· 32 31 console.log(`${cyan("?")} Choose a template: `); 33 32 template = await pkgx.run( 34 33 `gum choose pkgx nix devbox homebrew devenv flox`, 35 - "piped" 34 + "piped", 36 35 ); 37 36 await Deno.stdout.write(new TextEncoder().encode(magenta(template))); 38 37 template = template.trim(); ··· 58 57 if (existsSync(".pocketenv")) { 59 58 console.log( 60 59 `🚨 ${brightGreen( 61 - ".pocketenv" 62 - )} directory already exists. Please remove it and try again.` 60 + ".pocketenv", 61 + ) 62 + } directory already exists. Please remove it and try again.`, 63 63 ); 64 64 Deno.exit(1); 65 65 } ··· 74 74 75 75 const filePath = `${POCKETENV_CACHE_DIR}/${template.replaceAll( 76 76 "/", 77 - "-" 78 - )}.zip`; 77 + "-", 78 + ) 79 + }.zip`; 79 80 80 81 const branch = await getDefaultGithubBranch( 81 - template.split("/").length === 2 ? template : `pocketenv-io/${template}` 82 + template.split("/").length === 2 ? template : `pocketenv-io/${template}`, 82 83 ); 83 84 84 - const url = 85 - template.split("/").length === 2 86 - ? `https://codeload.github.com/${template}/zip/refs/heads/${branch}` 87 - : `https://codeload.github.com/pocketenv-io/${template}/zip/refs/heads/${branch}`; 85 + const url = template.split("/").length === 2 86 + ? `https://codeload.github.com/${template}/zip/refs/heads/${branch}` 87 + : `https://codeload.github.com/pocketenv-io/${template}/zip/refs/heads/${branch}`; 88 88 89 89 if (!existsSync(filePath)) { 90 90 const response = await fetch(url); ··· 100 100 101 101 if (!existsSync(`${cacheDir}/${template.split("/").pop()}-${branch}`)) { 102 102 await pkgx.installPackage("unzip"); 103 - await decompress(filePath, cacheDir); 103 + await pkgx.run(`unzip ${filePath} -d ${cacheDir}`, "inherit"); 104 104 await pkgx.run( 105 105 `terraform init`, 106 106 "inherit", 107 - `${cacheDir}/${template.split("/").pop()}-${branch}` 107 + `${cacheDir}/${template.split("/").pop()}-${branch}`, 108 108 ); 109 109 } else { 110 110 console.log( 111 - `💾 Using cached template: ${brightGreen(template)} ${brightGreen("...")}` 111 + `💾 Using cached template: ${brightGreen(template)} ${brightGreen("...") 112 + }`, 112 113 ); 113 114 } 114 115 115 116 await copyDir( 116 117 `${cacheDir}/${template.split("/").pop()}-${branch}`, 117 - standalone ? "." : ".pocketenv" 118 + standalone ? "." : ".pocketenv", 118 119 ); 119 120 } 120 121