Skip to content

nodist bash script for MinGW #14

Closed
marcelklehr opened this Issue Sep 4, 2012 · 3 comments

3 participants

@marcelklehr
Owner

There is still a bit of work to be done on this...

THe run command, etc.

@jdiamond jdiamond was assigned Sep 4, 2012
@juntalis juntalis added a commit to juntalis/nodist that referenced this issue Dec 20, 2014
@juntalis juntalis Should resolve issue #63 and possibly issue #14. 4ccad41
@juntalis juntalis added a commit to juntalis/nodist that referenced this issue Jul 14, 2015
@juntalis juntalis Should resolve issue #63 and possibly issue #14. 9eb5552
@juntalis juntalis added a commit to juntalis/nodist that referenced this issue Nov 8, 2015
@juntalis juntalis Should resolve issue #63 and possibly issue #14. 4f0d85a
@gmahomarf

Hi. I understand the complexities behind having a MinGW script for nodist, especially when it comes to nodist use|env needing to set the NODIST_VERSION env variable. I've come up with a workaround for my installation that I thought I'd share, in case it's useful to someone.

These scripts assume that the path to nodist is in $PATH

First, I edited my ~/.bashrc file and added:

alias nodist='source ~/bin/nodistproxy'

The code for ~/bin/nodistproxy is:

#!/bin/sh

if [ "$1" = "env" -o "$1" = "use" ]; then
    # Ported from nodist.cmd:
    # call %0 + %2
    # if ERRORLEVEL 0 (
    #   :: get version and set NODIST_VERSION
    #   FOR /F "tokens=1 delims=" %%A in ('"%0" add %2') do @set "NODIST_VERSION=%%A"
    # )
    \nodist + $2
    if [ $? -eq 0 ]; then
        export NODIST_VERSION=`\\nodist add $2`
    fi
else
    \nodist $*
fi

I didn't particularly need to run selfupdate/update from Git Bash, so I didn't add it here. However, it should be pretty easy to add the necessary conditions to nodistproxy for selfupdate/update. Hope this helps.

@marcelklehr
Owner

@gmahomarf Awesome! I'll definitely integrate this. Thank you for this contribution!

@marcelklehr marcelklehr assigned marcelklehr and unassigned jdiamond Mar 15, 2016
@gmahomarf

@marcelklehr Great! Let me know if there's anything I can do to help.

@marcelklehr marcelklehr added this to the 0.8 milestone Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.