Giter Club home page Giter Club logo

prm's People

Contributors

dexpota avatar dusty avatar eivindarvesen avatar fabiofortkamp avatar freddeschenes avatar gitter-badger avatar lalinsky avatar lelongg avatar qfjp avatar stanimirovv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prm's Issues

Feature request: shell completion

It would be a nice feature to have smart completion. It is in fact the only thing that prevents me from using prm everywhere.

Unfortunately, I do not have the skills (nor time to improve them right now) to write such a feature, so I am only suggesting.

Exit status

prm should return status codes, e.g. return 1 upon failure.

It is very important to use return, as opposed to exit, since the latter will kill the shell (since prm is sourced).

Some relevant lines can be seen in adbf77c.

Edit Readme (and other documentation)

I think the project readme is already getting too long and/or verbose.

It would maybe be best if the readme contained only the minimum needed information (subjects), such as the demo-gif, how to set up prm and get started, etc., so as to not overwhelm new users.

Other information, such as notes on contributions, could go into the wiki.

I would appreciate input about what should go where, be rewritten (and how), and so on.

Show something on bare command

Cool tool! I've enjoyed it so far.

From an interface perspective, I'd like to see some output when I type the bare command. Right now it's just illegal option --. Perhaps either print usage or a listing of active/all projects? Not sure what would be best, but it would be nice to save a few keystrokes and cue in on what to do next.

Distribution via package managers

prm should be distributed through various package managers (e.g. apt, brew, macports, pacman, yum...), though it should perhaps be postponed until there is a stable release.

Needs to include an append (alias) to a user dotfile or at least a message regarding proper use of prm (i.e. sourcing the script), e.g. via a post-install hook.

Project extendibility

Support creation of common modules/tasks that can be used across projects.

Could be solved by implementing a loader-function in prm (which would be automatically available in projects) that loads "$ARGUMENT.sh" from a reserved folder~~, and appropriate commandline args for manipulating these modules~~.

Feature request: Customize the opening of start and stop scripts

When using prm with cygwin on Windows, native editors can't handle the unix path.
Example:

$ bash -x ~/bin/prm/prm.sh add test1
+ sublime_text.exe /home/myusername/.prm/test1/start.sh
+ sublime_text.exe /home/myusername.prm/test1/stop.sh

Some way to customize the path is therefor wanted, and should provide the possibility to execute the following line:

sublimetext `cygpath.exe -d "/home/myusername/.prm/test1/start.sh"`

The line in question:
https://github.com/eivind88/prm/blob/master/prm.sh#L164

Feature request: project root

It would be nice to put a file in a directory so that I could do prm start without arguments anywhere under that directory and the appropriate project would start. This file could also indicate the base directory for relative paths in start.sh and stop.sh.

Start script stuck at `pipenv shell`

My setup

I use pipenv for python environment management and the following start script:

cd path/to/project
pipenv shell
git status

Stop script

exit
  • The script gets stuck after pipenv shell, which spawns a shell and places the terminal "inside that shell".
  • git status doesn't run until I leave the shell using exit
  • This means I can never prm stop as intended

Demonstration

Here I use:

  • prm start - note cd executes and we are placed inside pipenv shell. Can be seen from (AIMAS) on left hand side
  • prm stop - prm says no active project because prm start hasn't finished executing
  • exit - I use exit to leave the shell the git status executes

b

Making the prm project path a configuration parameter

Currently the only possible project path is $HOME/.prm/
which means that if I want to use prm for my projects I must

  1. Obey it's structure and move my projects there
  2. Edit the source of prn and set it to my project directory

The latter isn't a solution since if I have for example several directories with projects (for example work and personal)
It won't work.

I suggest to make the path based on an enviroment variable and fallback to the default path only if it isn't set.
That should solve the described problem above. If this makes scence to you and you agree please say so. I will make a
pull request with the edit.

GitHub Pages

This repo should have GitHub Pages when 1.0.0 is released.
The pages should be end user-centered – unlike the Readme and Wiki, which can contain details.

Editing start/stop scripts is broken on Cygwin

This relates to PR #27, which introduced a check with "uname" to use the "cygpath" executable when opening the scripts. This works fine when using an editor external to Cygwin (ex: Sublime Text), but editors installed in Cygwin (ex: vim) will most likely not be able to open a file with a native Windows path.

I've made PR #35 to make the usage of "cygpath" optional.

[zsh] "source test" fails although it is sourced

Hey,

first of all, I really like prm as project manager. Unfortunately I ran into the following problem:
The test if prm.sh is executed or sourced, i.e.

# Test if prm is run in subshell or sourced
if [ "$(basename "${0//-/}")" = "prm.sh" ]; then
    return_error 1 "$(printf "$SOURCE")"
    exit
fi

evaluates in zsh to true, even if the script is sourced. I know far too less zsh things to tell you why, but my very basic investigation (I echoed $(basenamen "${0//-/}") ) showed that it evaluates to "prm.sh" on execution as well as sourcing the script. Unfortunately I didn't find for now a reliable zsh/bash-independent way of testing for this. By now prm just crashed because sourcing this file closes my shell because of "exit".

I try to find a proper solution on my own, but any help is appreciated since I am very unfamiliar with bash/zsh!

All the best,
Christoph

branch: master
commit: 97e7598

Edit Wiki

The Wiki should be updated, in both structure and content.
Related to issue #19.

Error handling and messages

Handle some edge cases, probably needs a couple of error messages as well.

  • What if files dissappear at unexpected points?
  • What if users try to name project something that exists (e.g. temp-file) or is reserved or starts with dot?

Related to issue #12.

Some relevant lines can be seen in adbf77c.

Testing, CI?

It would be great to have some sort of testing, so that contributors don't have to manually perform every action/combination that could be affected by their changes, or worse yet, don't test at all.

It would probably be best to set up integration with Travis CI, or something, but I have no idea what options exist for testing with bash and zsh – except for shUnit2, which I recently stumbled upon.

does not work with fish shell

I added the alias as instructed, when running prm, I get the following error:

'case' builtin not inside of switch block
~/dev/notmine/prm/prm.sh (line 15): case "$1" in
                                    ^
from sourcing file ~/dev/notmine/prm/prm.sh
    called on line 151 of file /usr/local/Cellar/fish/2.2.0/share/fish/config.fish

in function '.'
    called on line 1 of file -

in function 'prm'
    called on standard input

source: Error while reading file '/Users/dan/dev/notmine/prm/prm.sh'

prm stop fails in ZSH

I am sure that is probably not supported but any chance you can point me to why project stop is failing to drop back to a normal shell

ryan@galileo ~/illustris- ❯❯❯ prm stop illustris                                                                                                                                         master On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
Already up-to-date.
Stopping project illustris
rm: remove regular file ‘/home/ryan/.prm/.active.d’? y
rm: remove regular file ‘/home/ryan/.prm/.path.d’? y
/home/ryan/prm/prm.sh:export:144: not valid in this context: "}%F{4}${_prompt_sorin_pwd}%(!.
zsh: parse error
${SSH_TTY:+"ryan@galileo                                                                                                                                                                      ⏎ _zsh_highlight_widget_reset-prompt: parse error
${SSH_TTY:+"ryan@galileo                                                                                                                                                                      ⏎ _zsh_highlight_widget_reset-prompt: parse error
${SSH_TTY:+"ryan@galileo

Copy option

Add a copy function that copies a project (and opens associated start- and stop-scripts in $EDITOR?)

Might look like this:

prm copy <old> <new>

As proposed by @FredDeschenes in issue #14.

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.