File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,9 @@ function CmdProcessor:install()
269269 if self ._pm_executor :install (xpkg ) then
270270 self :_restart_tips ()
271271 cprint (" [xlings:xim]: ${green bright}%s${clear} - installed" , self .target )
272+ if self .cmds .sys_use then
273+ self ._pm_executor :use ()
274+ end
272275 index_manager .status_changed_pkg [self .target ] = {installed = true }
273276 else
274277 self :_feedback ()
@@ -350,7 +353,8 @@ function CmdProcessor:update()
350353 cprint (" [xlings:xim]: ${bright}try to update [ %s ] to latest version...${clear}" , self ._input_target )
351354 new (self ._input_target .. " @latest" , {
352355 yes = true ,
353- disable_info = true
356+ disable_info = true ,
357+ sys_use = true
354358 }):run ()
355359 end
356360end
Original file line number Diff line number Diff line change 11-- runtime dir is cachedir
22
33import (" xim.base.runtime" )
4+ import (" xim.base.xvm" )
45import (" xim.pm.XPkgManager" )
56
67local PkgManagerExecutor = {}
@@ -71,6 +72,10 @@ function PkgManagerExecutor:install()
7172 return true
7273end
7374
75+ function PkgManagerExecutor :use ()
76+ xvm .use (self ._pkg .name , self ._pkg .version )
77+ end
78+
7479function PkgManagerExecutor :_config ()
7580 -- only for xpm, and called in install
7681 if self ._pkg .hooks .config then
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ function _input_process(args)
3232 [" --add-xpkg" ] = false , -- --add-xpkg (string)
3333 [" --add-indexrepo" ] = false , -- --add-indexrepo (string)
3434 [" --xpkg-args" ] = false , -- --xpkg-args (string)
35+ [" --use" ] = false , -- --use (string)
3536 }
3637
3738 if # args > 0 and args [1 ]:sub (1 , 1 ) ~= ' -' then
@@ -74,6 +75,7 @@ function _input_process(args)
7475 sysxim_args = args , -- is table, xim's original args
7576
7677 info_json = boolean_cmds [" --info-json" ],
78+ sys_use = kv_cmds [" --use" ],
7779 }
7880
7981 return main_target , cmds
You can’t perform that action at this time.
0 commit comments