Skip to content

Commit

Permalink
xpkg: update project-graph for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunrisepeak committed Jan 19, 2025
1 parent 8bcaa1b commit 6fcee3c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkgs/p/project-graph.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ function config()
local xvm_cmd_template = [[xvm add project-graph %s --path "%s"]]
local project_graph_path = path.join(pkginfo.install_dir, "bin")
if os.host() == "windows" then
-- TODO: support multi-version for windows
print("remove old version...")
os.exec("xvm remove project-graph --yes") -- remove old version
project_graph_path = "C:\\Users\\" .. os.getenv("USERNAME") .. "\\AppData\\Local\\Project Graph"
else
config_desktop_shortcut("create")
Expand All @@ -112,12 +115,14 @@ function config()
end

function uninstall()
local xvm_rm = "xvm remove project-graph "
if os.host() == "windows" then
utils.prompt("等待卸载/waiting uninstall...")
common.xlings_exec("\"C:\\Users\\" .. os.getenv("USERNAME") .. "\\AppData\\Local\\Project Graph\\uninstall.exe\"")
utils.prompt("等待卸载/waiting uninstall...")
os.exec(xvm_rm)
elseif os.host() == "linux" then
config_desktop_shortcut("delete")
os.exec("xvm remove project-graph " .. pkginfo.version)
os.exec(xvm_rm .. pkginfo.version)
end
return true
end
Expand Down

0 comments on commit 6fcee3c

Please sign in to comment.