是否可以在知道要安装的包但不知道卷名的 OSX 上调用安装程序?
我什至不确定是否可能,但我想从通过符号链接安装在我的 osx 上的卷安装一个包。
该名称每天都会更改,因为它在标题上带有时间戳,因此每天该卷都会有不同的名称(这就是为什么我有一个符号链接来每天安装最新的名称)。
是否可以在不指定卷名称的情况下运行安装程序?它已安装,但当我尝试使用 *testdisk 访问它时(testdisk 是永不更改的卷的名称,日期附加在其后面的末尾),我从安装程序中收到错误,因为它找不到路径。
如果我可以在路径中使用通配符,那就太好了,所以无论卷名称是什么,如果它获取卷名称的一部分,它将指向该卷。
如果这是不可能的,我将只查找已安装的卷并从那里获取名称,并将其作为参数传递给安装程序;但如果安装程序能够做到这一点,我想避免它。
I am not even sure if is possible, but I would like to install a package from a volume that is mounted on my osx via symlink.
The name changes every day, since it carry the timestamp on the title, so each day the volume will have a different name (and that's why I have a symlink to mount the newest one every day).
IS possible to run installer without specify the name of the volume? It is mounted but when i try to access it using *testdisk (testdisk is the name of the volume that never change, the date is appended at the end right after it) I get an error from Installer because it cannot find the path.
Would be great if i can use in the path the wildcard, so no matter what the volume name is, if it gets part of the name of the volume it will point to that volume.
If this is not possible I will just look for the mounted volume and get the name from there, and pass it as parameter to the installer; but I would like to avoid it if installer is able to do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这会给你你的驱动器名称
this will give you your drive name
您可以使用 pwd -P(至少在 bash 和 zsh 中)来打印给定符号链接的目录路径。
因此,类似这样的操作应该有效:
installer -pkg ... -target "$(cd /path/to/target/symlink ; pwd -P)"
You can use
pwd -P
(at least in bash and zsh) to print the path to a directory given a symlink.So, something like this should work:
installer -pkg ... -target "$(cd /path/to/target/symlink ; pwd -P)"