Code Monkey home page Code Monkey logo

Comments (3)

ocean avatar ocean commented on July 17, 2024 1

@Corey-Lylyk Each command that ahoy runs is run inside a separate bash -c "<your-command-here>" subroutine, so if you run your source command outside that, it will not pick up the same environment variables when inside the bash subroutine.

I'm not sure I'm explaining this very clearly (and I'm not the original author of ahoy so I don't have complete domain knowledge), but I think you should be able to achieve what you want by making your my_release_script.sh have a shebang line (that is, start with #!/bin/bash) and be executable, and then running something like:

ahoyapi: v2
commands:
  release:
    cmd: |
      source venv/bin/activate &&
      ./my_release_script.sh
    usage: Runs my_release_script.

Notice that the command is now broken over multiple lines for ease of reading. In the first line the Python virtualenv is activated, then the Bash logical operator (&&) is used to make sure your release script command on the next line is only run if the virtualenv activation ran successfully.

from ahoy.

ocean avatar ocean commented on July 17, 2024

@Corey-Lylyk Hmm, can you give me a bit more information about what you're trying to run?

E.g. are you running this source command as part of a string of other commands, where you want the virtualenv to be active for those other commands?

from ahoy.

Corey-Lylyk avatar Corey-Lylyk commented on July 17, 2024

Yeah originally I'm using the command
source ./my_release_script.sh
and I would like to use something like
ahoy release

the ahoy file would have:

ahoyapi: v2
commands:
  release:
    cmd: source my_release_script.sh
    usage: Runs my_release_script.

I need the script to run in the ahoy command terminal

from ahoy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.