Coder Social home page Coder Social logo

nixd's People

Contributors

rduplain avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

nixd's Issues

Add activate script.

In one of my projects, I have a script at ./bin/nixd_env which looks like this:

#!/bin/bash

export GEM_HOME=$PWD/nixd/usr
export RUBYOPT=rubygems

for dir in $PWD/nixd/bin $PWD/nixd/usr/bin $PWD/nixd/opt/*/bin ; do
    export PATH=$dir:$PATH
done

for dir in $PWD/src/python2/*; do
    export PYTHONPATH=$dir:$PYTHONPATH
done

exec $@

Callers look like this:

./bin/nixd_env nixd install all
./bin/nixd_env python2.7 -m SimpleHTTPServer

Since nixd provides environments, having a shell activation script would be very convenient. This would likely require a hook for package scripts to provide environment variables, where nixd picks up the entire environment based only on what's provided by package scripts.

Add clean command.

Consider adding a 'clean' command, both top-level and in package scripts. A clean recipe is:

rm -fr nixd/usr/ nixd/opt/ nixd/src/ nixd/var/

However, removing nixd/src/ is inconvenient if you do not have NIXD_MIRROR set. An alternative would be to have clean be:

rm -fr nixd/usr/ nixd/opt/ nixd/var/
nixd/bin/nixd clean

Each package script would then remove any files in src which are added during pretest and install.

Add a command-line parser.

All arguments in v0.3 are positional and straightforward to parse using shift. Everything is configurable through environment variables but in some cases, that's an implementation detail. Provide flags for NIXD_VERBOSE and NIXD_DIR.

Here is a good discussion on getopt vs getopts:
http://blog.onetechnical.com/2012/07/16/bash-getopt-versus-getopts/

I prefer use of GNU-style long options, e.g. -v and --verbose, which rules out getopts.

Add a help command.

Support nixd help and nixd help command.

Currently, nixd prints a useful message when called without arguments, showing the configuration variables and describing each of the available subcommands. The published README covers all topics, and nixd logs a lot of useful messages when verbose. But nixd does not have a help command.

Change `check` to `assert`.

I have been looking for a better name than "check" for the function/subcommand which checks whether or not there is work to do for a package script. So far, "check" has served well because it is short/simple and does not have the same ambiguity issue that names like "test", "configtest", and "ready" have. That is, the notion of being ready is different from the perspective of writing the script as from running it.

nixd will check if there's work to do as a means to assert that the package script's intent is consistent with the project's needs. As a consistency check, "assert" is clearer than "check".

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.