MCPcopy Create free account
hub / github.com/VSCodeConfigHelper/v4 / create

Function create

src-tauri/src/tasks/mod.rs:122–143  ·  view source on GitHub ↗
(args: &TaskArgs)

Source from the content-addressed store, hash-verified

120
121 #[cfg(windows)]
122 pub fn create(args: &TaskArgs) -> Result<()> {
123 let path = dirs::desktop_dir()
124 .ok_or(anyhow!("找不到桌面路径。"))?
125 .join("Visual Studio Code.lnk");
126 if path.exists() {
127 warn!("快捷方式 {:?} 已存在,将被覆盖。", path);
128 }
129 // Use exe instead of cmd, for showing vscode icon
130 let vscode_exe = Some(&args.vscode)
131 .and_then(|p| p.parent())
132 .and_then(|p| p.parent())
133 .unwrap()
134 .join("Code.exe")
135 .to_string();
136 create_lnk(
137 path.to_str().unwrap(),
138 &vscode_exe,
139 &format!("Open VS Code at {}", args.workspace.to_string()),
140 &format!("\"{}\"", args.workspace.to_string()),
141 )?;
142 Ok(())
143 }
144
145 #[cfg(not(windows))]
146 pub fn create(_args: &TaskArgs) -> Result<()> {

Callers 1

setupFunction · 0.85

Calls 2

create_lnkFunction · 0.85
to_stringMethod · 0.80

Tested by

no test coverage detected