0

In my Rails (Release 6) web application I'll use a bash script to do some action. The app will call the script in a controller with a fragment inside backticks.

def action
    ...
    `#{custom_script_dir}/my_script.sh`
    ...
    render ...
end

Which directory I should place my script into? Is there a standard place for such custom extra shell scripts?

1
  • I just have a script folder at the repo root Commented Apr 8, 2020 at 12:44

1 Answer 1

1

There isn't a strong convention for this.

Maybe you can use the bin folder. Look at this answer as an example:

What's inside my rails ./bin directory?

... I personally do put some stuffs[sic] in the bin folder. Scripts to connect to remote servers, or ruby scripts I need but that I don't want to run as rake tasks since they're more general than my application. ...

However, it is up to you to decide which folder is the best for you. Also, feel free to create as many folders as you want in your Rails application if it makes sense for your project.

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.