Coder Social home page Coder Social logo

hermit's Introduction

hermit

Clojure wrapper around command line programmes bundled within your project

Works from within the repl and within uberjars

Installation

Add the following to the :dependencies section of your project.clj file:

    [savagematt/hermit "0.9"]

Usage

This example will run from within any project that imports hermit:

    (rsh! "hermit/helloworld/hello_world.sh" "Dave")

hello_world.sh is bundled with hermit.

The full contents of the parent directory of the script will be copied to a temp directory before execution and all .sh files will be chmod +x.

The script with be run within the context of the temp directory

If your script has dependencies in other packages, you can do this:

    (with-deps-in-package ["hermit/helloworld/hello_world.sh"]
      (println (rsh! "hermit/otherpackages/call_script_in_another_package.sh" "Dave")))

The full contents of the parent package of hermit/helloworld/hello_world.sh will be copied into the script directory.

If your script requires a dependent package to be in a different directory, you can alias it:

    (with-deps-in-package [["hermit/helloworld/hello_world.sh" "aliased_helloworld"]]
      (println (rsh! "hermit/otherpackages/call_script_in_aliased_package.sh" "Dave")))

Again, call_script_in_aliased_package.sh and call_script_in_another_package.sh are bundled with hermit so this example will work..

hermit's People

Contributors

savagematt avatar no-man-is-an-island avatar

Stargazers

 avatar Michael Rubanov avatar

Watchers

 avatar James Cloos avatar

hermit's Issues

Using resource paths to packages doesn't work

In all cases we've found up until now, (io/resource "some/package") worked fine.

We have a bug in a project where getting the url for a package works for some dependencies, but not others. It's unclear why this is the case- the packages look identical in /target and in the uberjar. (io/resource "some/package/actual_file.sh") works fine in all cases.

We need to revert to the standard Java approach of using reference paths to real resources.

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.