Skip to content

Commit

Permalink
export now works for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiboSoftwareDev committed Sep 27, 2024
1 parent 18bd411 commit 16831e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 0 additions & 8 deletions cli/lib/soupify/run-entrypoint-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ export const runEntrypointFile = async (
ctx: Pick<AppContext, "runtime" | "params">,
) => {
try {
console.log(1)
debug(`using runtime ${ctx.runtime}`)
const processCmdPart1 =
ctx.runtime === "node"
? $`npx tsx ${tmpEntrypointPath}`
: $`bun ${tmpEntrypointPath}`
console.log(2)

debug(`starting process....`)
console.log(debug.enabled)

try {
const processResult = await processCmdPart1
Expand All @@ -36,12 +32,9 @@ export const runEntrypointFile = async (
} catch (e) {
console.log(e)
}

console.log(tmpOutputPath)
const rawSoup = await readFile(tmpOutputPath, "utf-8")
// const errText = processResult.stderr

console.log(4)
if (ctx.params.cleanup !== false) {
debug(`deleting ${tmpEntrypointPath}`)
await unlink(tmpEntrypointPath)
Expand All @@ -58,7 +51,6 @@ export const runEntrypointFile = async (
console.log(kleur.red(soup.COMPILE_ERROR))
throw new Error(soup.COMPILE_ERROR)
}
console.log("final")
return soup
} catch (e: any) {
// console.log(kleur.red(`Failed to parse result of soupify: ${e.toString()}`))
Expand Down
6 changes: 5 additions & 1 deletion cli/lib/util/create-context-and-run-program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export const createContextAndRunProgram = async (process_args: any) => {
},
)

function isBunRuntime() {
return typeof process !== "undefined" && "isBun" in process
}

const ctx: AppContext = {
cmd: args._,
cwd: args.cwd ?? process.cwd(),
Expand All @@ -112,7 +116,7 @@ export const createContextAndRunProgram = async (process_args: any) => {
axios,
global_config,
profile_config,
runtime: global_config.get("runtime") ?? "node",
runtime: isBunRuntime() ? "bun" : (global_config.get("runtime") ?? "node"),
args: {
cmd: args._,
yes: args.y ?? args.yes,
Expand Down

0 comments on commit 16831e0

Please sign in to comment.