Skip to content

Commit

Permalink
add custom URL support, fix for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mattvr committed Mar 8, 2024
1 parent 4d893ec commit 66be523
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export interface Image {


const OPENAI_API_KEY = Deno.env.get("OPENAI_API_KEY");
const OPENAI_CHAT_URL = "https://api.openai.com/v1/chat/completions";
const OPENAI_IMG_URL = "https://api.openai.com/v1/images/generations";
const OPENAI_CHAT_URL = Deno.env.get("OPENAI_CHAT_URL") || "https://api.openai.com/v1/chat/completions";
const OPENAI_IMG_URL = Deno.env.get("OPENAI_IMG_URL") || "https://api.openai.com/v1/images/generations";

export const aiConfig = {
debug: false,
Expand Down
4 changes: 4 additions & 0 deletions lib/shell.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export function getExecPrefix(): string[] {
const envShell = Deno.env.get('SHELL')
const platform = Deno.build.os
if (envShell?.endsWith('pwsh.exe') || envShell?.endsWith('powershell.exe')) {
return [envShell, '-Command']
}
Expand All @@ -9,6 +10,9 @@ export function getExecPrefix(): string[] {
else if (envShell) {
return [envShell, '-c']
}
else if (platform === 'windows') {
return ['cmd.exe', '/C']
}
else {
return ['sh', '-c']
}
Expand Down

0 comments on commit 66be523

Please sign in to comment.