就像我们有一些脚本可以找到 eclipse 的安装位置为 {workspace_loc}。我尝试了更多的语法,但没有一个能告诉我方法。
2 回答
1
如果您的程序使用用户库中的工作区启动,则下面的此 ECL 脚本有效。仅适用于 Windows;如果您需要基于 Unix 的解决方案,只需将“\\”文字更改为“/”文字。
/* Stores User's home path into global "user_home" if workspace location is within the user folder. */
proc introduce_user_home {
// Splitting up workspace path
let [val splitted [get-workspace-location | split -sep "\\" | to-list]] {
let [val user_part
// Concatenating the part that matters
[concat [$splitted | get 0 | str] // C:
"\\"
[$splitted | get 1 | str] // Users
"\\"
[$splitted | get 2 | str] // Jagadeesh
]] {
get-window $user_part
// Introducing it as a global
global [val "user_home" [$user_part]] -override true
}
}
}
于 2017-07-18T11:55:08.273 回答
1
我找到了一种使用环境变量定位用户目录的方法
替代变量“${system_property:user.home}”
上面的代码是定位用户目录。
于 2017-09-20T09:33:43.357 回答