Bash script behaving like a development v
version running/compiling v
files using imported modules in official version or development version
- Clone this directory or donwload the vdev.sh
vdev.sh
bash script - Create a directory
~/vdevmodules
similar to~/.vmodules
but for testing development repo. - Update
VDEVMODULES
andVEXE
(default:~/vlang/v/v
) environment variables insidevdev.sh
if necessary chmod u+x vdev.sh
- Link
vdev.sh
script as you wish. It could also serve of symlinking version of thev
binary (ex:ln -s vdev.sh ~/bin/vv
to have bothv
binary andvv
development version)
- A development mode to test modules in development is provided:
- normal mode:
vdev.v
(or the corresponding~/bin/vv
symlink if created) behaves the same as thev
binary except the following completion about thev
file path to run when starting with%
. - development mode:
vdev.sh -dev
( orvv -dev
) allows us to run/compile v file by importing modules installed inside~/vdevmodules
skipping the modules usually installed inside~/.vmodules
.
- normal mode:
- Path of a
v
file to run when starting with%
, such as%<v_fullpath_file>.v
, is prepended with the folder containing thev
modules:
~/.vmodules/
in normal mode~/vdevmodules/
in devel mode, i.e. with-dev
option
Here it is supposed that ~/bin/vv
is the symlink of vdev.sh
and ~/bin
part of $PATH
such that type vv
is ~/bin/vv
. After installing official version ui
(v install ui
) and a development version of ui
inside ~/vdevmodules
(cd ~/vdevmodules;git clone -b devel17 https://github.com/rcqls/ui
). You can then run ui/examples/users_resizable.v
in the two modes:
- normal mode:
vv run %ui/examples/users_resizable.v
(equivalent tovv run ~/.vmodules/ui/examples/users_resizable.v
) using the officialui
module inside~/.vmodules
- development mode:
vv -dev run %ui/examples/users_resizable.v
(equivalent tovv -dev run ~/vdevmodules/ui/examples/users_resizable.v
) using the development module~/vdevmodules
.
Remark: tested on macOS, linux and Windows10 (using GitBash)