#291 Startup scripts

closed-fixed
nobody
Testing (4)
5
2012-06-10
2011-07-31
mikeu
No

This item is to track the vstar.bat (MSDOS batch script) and vstar.sh (*nix batch script) to start VStar.

Discussion

1 2 3 > >> (Page 1 of 3)
  • mikeu
    mikeu
    2011-07-31

    The /bin/sh startup script should probably be renamed from "vstar" to "vstar.sh"

    On linux if my current working directory is $HOME and I have a directory $HOME/vstar containing the files from trunk, running ./vstar/vstar causes the error "Unable to access jarfile ./dist/vstar.jar" The script is using my current directory and not the dir that the shell script lives in. So it only works if you are in the directory with the script.

     
  • mikeu
    mikeu
    2011-07-31

    Opps, ignore that last comment about the current working directory. I hadn't set the environment variable properly.

    It should be possible to have the script figure out where it is running out of and set this automatically.

     
  • David Benn
    David Benn
    2011-07-31

    • priority: 5 --> 7
     
  • David Benn
    David Benn
    2011-07-31

    Thanks for looking at these Mike. If you have a Windows machine handy, feel free to test vstar.bat. I added these scripts recently with minimal testing. I've been using the sh script though.

    Point taken re: vstar.sh. I guess we ought to have vstar.csh also. What I liked about 'vstar' vs 'vstar.sh' is that the user can just type 'vstar', as a DOS user could with the batch script. I don't feel that strongly about it though.

    Creating an installer per platform might make it possible to hide such differences in invocation, but I wouldn't say it's a high priority.

     
  • mikeu
    mikeu
    2011-07-31

    For the DOS vstar.bat script, it should be changed to:

    if not "%VSTAR_HOME%" == "" GOTO RUN

     
  • mikeu
    mikeu
    2011-07-31

    • priority: 7 --> 5
     
  • mikeu
    mikeu
    2011-07-31

    On the side topic of starting VStar, is it possible to start vstar from the command line with plugins disabled? I really like the plugins and have only just started to try them out. From a testing/debug perspective it would be nice to have a -noplugins switch on the command line to temporarily disable the plugins to track down the source of an error.

     
  • mikeu
    mikeu
    2011-07-31

    One possibility for vstar.bat is to use:

    set VSTAR_HOME=%~dp0

    which returns the directory that the script lives in (regardless of current working directory) per:

    http://weblogs.asp.net/whaggard/archive/2005/01/28/get-directory-path-of-an-executing-batch-file.aspx

    Tested only on XP, this allows clicking the script icon in a folder or running from the command line from any directory and the script will use the path relative to what directory it is in..

     
  • mikeu
    mikeu
    2011-07-31

    I'm not sure we need versions of the script for csh (or ksh, etc) Most people write scripts in sh when they want portability and most (all of the ones that I am aware of) *nix like systems will handle sh scripts just fine regardless of which shell the person is using. Works fine on Solaris, Ubunto, CentOS depite my choice of login shell. Trying to keep track of multiple startup scripts could get messy.

     
  • David Benn
    David Benn
    2011-08-01

    Nice. Yes, this is the kind of thing I've seen before for DOS. Feel free to commit your changes to the batch file.

    I think there's similar approaches for Bourne shell re: CWD/PWD.

    I agree re: csh vs sh vs ksh vs zsh. :)

    Re: plugin disabling: good idea. I can do that.

     
1 2 3 > >> (Page 1 of 3)