File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 23
23
}
24
24
25
25
phpvm_latest_version () {
26
- # Fetch the latest version from GitHub
27
26
latest_version=$( curl -s https://api.github.com/repos/Thavarshan/phpvm/releases/latest | grep ' "tag_name":' | sed -E ' s/.*"([^"]+)".*/\1/' )
28
-
29
- # Default to main if the version is not found
30
27
if [ -z " $latest_version " ]; then
31
28
latest_version=" main"
32
29
fi
33
-
34
30
phpvm_echo " $latest_version "
35
31
}
36
32
84
80
phpvm_echo >&2 ' Failed to install Node.js dependencies. Please report this!'
85
81
exit 1
86
82
}
83
+
84
+ # Ensure the bin directory and executable exist
85
+ phpvm_create_bin
86
+ }
87
+
88
+ phpvm_create_bin () {
89
+ local INSTALL_DIR
90
+ INSTALL_DIR=" $( phpvm_install_dir) "
91
+
92
+ # Create the bin directory if it doesn't exist
93
+ mkdir -p " $INSTALL_DIR /bin"
94
+
95
+ # Create a symlink to the phpvm executable
96
+ ln -sf " $INSTALL_DIR /index.js" " $INSTALL_DIR /bin/phpvm"
97
+
98
+ # Make the symlink executable
99
+ chmod +x " $INSTALL_DIR /bin/phpvm"
87
100
}
88
101
89
102
phpvm_detect_profile () {
You can’t perform that action at this time.
0 commit comments