You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vfox add --source fails with a raw rename error when VFOX_HOME does not exist #825
With VFOX_HOME set to a directory that does not exist, vfox add --source validates the plugin, then fails with an operating system error. docs/guides/multi-user-sharing.md asks users to create the directory first (mkdir -p /opt/vfox, then export VFOX_HOME=/opt/vfox). The error does not name VFOX_HOME, and the code that should create the directories ignores its errors.
The same error occurs when only VFOX_HOME itself is missing and its parent exists (checked on Linux with vfox 1.1.0).
Without VFOX_HOME, a HOME that has no .vfox yet works: vfox add --source exits 0, because $HOME/.vfox is created.
With the same missing VFOX_HOME, vfox list exits 1 with you don't have any sdk installed yet, which does not say that the directory is missing.
Cause: internal/pathmeta/path_meta.go:143 creates $HOME/.vfox/tmp with os.MkdirAll, but path_meta.go:145-146 create the installs and plugin directories of VFOX_HOME with os.Mkdir, which does not create parents, and ignore its error (_ = os.Mkdir(...)). The rename of the validated plugin into plugin/ then fails, and internal/manager.go:563 wraps it as install plugin error.
Expected: VFOX_HOME is created, or add stops before the download with a message that names VFOX_HOME.
Severity: low. The directory is a documented step, so this concerns the error message and the ignored errors.
Activity
fix(pathmeta,manager): check writable plugin dir in Manager.Add and k…