Skip to content

Commit c1d5cd2

Browse files
committed
update: init commands
1 parent 0537ba0 commit c1d5cd2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/commands/setup/setup.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ import { logger } from "../../global/log";
44
import { fs } from "./assets";
55
import process from "process";
66

7+
8+
const zshrcContent = `# This function is used to set up the environment for Weaponized folders and auto source .vscode/.zshrc files
9+
weapon_vscode_launch_helper () {
10+
if [ -n "$PROJECT_FOLDER" ]; then
11+
if [ -f "$PROJECT_FOLDER/.vscode/.zshrc" ]; then
12+
source $PROJECT_FOLDER/.vscode/.zshrc
13+
fi
14+
fi
15+
}
16+
weapon_vscode_launch_helper
17+
`;
18+
719
const checkShellProfile = async (): Promise<boolean> => {
820
let stats = await vscode.workspace.fs.stat(
921
vscode.Uri.file(process.env.HOME + "/.bashrc")
@@ -53,8 +65,12 @@ export const checkEnvironmentSetup = async (): Promise<void> => {
5365
vscode.workspace.openTextDocument(openPath).then((doc) => {
5466
vscode.window.showTextDocument(doc);
5567
});
68+
vscode.env.clipboard.writeText(
69+
zshrcContent
70+
);
5671
vscode.window.showWarningMessage(
57-
"[Weaponized] shell profile is not set up. Please check your shell profile (e.g., .bashrc, .zshrc). "
72+
"[Weaponized] shell profile looks not setup correctly. Please check your shell profile (e.g., .bashrc, .zshrc).",
73+
"and Copy the content in clipboard to your .zshrc",
5874
);
5975
}
6076
};

0 commit comments

Comments
 (0)