Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use lang: powershell on windows #1040

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion screenpipe-app-tauri/components/cli-command-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
DialogTitle,
} from "./ui/dialog";
import { CodeBlock } from "./ui/codeblock";
import { platform } from "@tauri-apps/plugin-os";
import { useCopyToClipboard } from "@/lib/hooks/use-copy-to-clipboard";
import { useToast } from "@/components/ui/use-toast";
import { IconCode } from "./ui/icons";
Expand Down Expand Up @@ -138,7 +139,10 @@ export function CliCommandDialog({ settings }: CliCommandDialogProps) {
</DialogDescription>
</DialogHeader>
<div className="overflow-x-auto">
<CodeBlock language="bash" value={generateCliCommand()} />
<CodeBlock
language={platform() === "windows" ? "powershell" : "bash"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

can you do bun tauri build

usually you cannot use platform() like this - build crash

because nextjs does not know tauri APIs

so you need to put it in a function or useeffect

maybe it would make sense to create a hook because we have useeffect for this everywhere - kinda dirty

value={generateCliCommand()}
/>
</div>
<DialogFooter>
<Button onClick={handleCopyCliCommand}>Copy to Clipboard</Button>
Expand Down
2 changes: 1 addition & 1 deletion screenpipe-app-tauri/components/dev-mode-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export const DevModeSettings = ({ localDataDir }: { localDataDir: string }) => {
thru CLI 👇
</p>
<CodeBlock
language="bash"
language={platform() === "windows" ? "powershell" : "bash"}
value={getDebuggingCommands(platform(), localDataDir)}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const OnboardingDevConfig: React.FC<OnboardingDevConfigProps> = ({
</p>
<CodeBlock
className="rounded-md mt-2"
language="bash"
language={platform() === "windows" ? "powershell" : "bash"}
value={instructions.command}
/>
</li>
Expand Down
Loading