Skip to content

Commit 1951d5f

Browse files
committed
create composer folder inside php version
1 parent 523543e commit 1951d5f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

commands/install.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,13 @@ func Install(args []string) {
188188
}
189189

190190
// install composer
191-
composerPath := filepath.Join(phpPath, "composer", "composer.phar")
191+
composerFolderPath := filepath.Join(phpPath, "composer")
192+
if _, err := os.Stat(composerFolderPath); os.IsNotExist(err) {
193+
theme.Info("Creating .pvm/versions folder in home directory")
194+
os.Mkdir(composerFolderPath, 0755)
195+
}
196+
197+
composerPath := filepath.Join(composerFolderPath, "composer.phar")
192198
composerUrl := "https://getcomposer.org/download/latest-stable/composer.phar"
193199
if desiredVersion.LessThan(common.Version{Major: 7, Minor: 2}) {
194200
composerUrl = "https://getcomposer.org/download/latest-2.2.x/composer.phar"

0 commit comments

Comments
 (0)