2 # This is based on the script by David T. Lewis posted here:
3 # http://lists.squeakfoundation.org/pipermail/vm-dev/2017-April/024836.html
5 # VM run utility script
8 # Select a VM and run an image based on the image format number
12 # Search for the image filename in the command line arguments
13 for arg
in $
* $SQUEAK_IMAGE; do
17 *) # either an option argument or the image name
18 if test -e ${arg}; then
19 magic
=$
(file -L -b -m @magic@
"$arg")
21 "Smalltalk image V3 32b"*)
23 vm
=@cog32@
/bin
/pharo-cog
25 "Smalltalk image Spur 32b"*)
27 vm
=@spur32@
/bin
/pharo-spur
29 "Smalltalk image Spur 64b"*)
30 if [ "@spur64vm@" == "none" ]; then
31 echo "error: detected 64-bit image but 64-bit VM is not available" >&2
35 vm
=@spur64@
/bin
/pharo-spur64
43 # Print a message to explain our DWIM'ery.
44 if [ -n "$image" ]; then
45 echo "using VM selected by image type."
50 echo "using default vm; image type not detected"
51 vm
=@cog32@
/bin
/pharo-cog