0

I'm having vollowing bash script, which executes another script and then executes the next argument:

TOOLS=`dirname $0`
VENV=$TOOLS/../.venv
source $VENV/Scripts/activate && "$@"

How can I convert this to be able execute this inside a windows command line?

3
  • Does it have to be batch? Batch needs to go away. Convert to PowerShell if at all possible. Commented Oct 20, 2013 at 19:46
  • 3
    The equivalent of dirname $0 is %~dp0 and the rough equivalent of source is call. Commented Oct 20, 2013 at 19:49
  • Unfortunatly I've to use batch. Commented Oct 20, 2013 at 21:21

1 Answer 1

1

I managed it with following script

@ECHO OFF
SET VENV=%~dp0..\.venv
CALL "%VENV%\Scripts\activate.bat"
CALL %*
CALL "%VENV%\Scripts\deactivate.bat"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.