Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links to the documention are broken :( #1

Open
svetlyak40wt opened this issue Apr 3, 2024 · 5 comments
Open

Links to the documention are broken :( #1

svetlyak40wt opened this issue Apr 3, 2024 · 5 comments
Assignees

Comments

@svetlyak40wt
Copy link

No description provided.

@foretspaisibles
Copy link
Collaborator

foretspaisibles commented Apr 8, 2024

The links used to point to artefacts produced by a workflow and those seems to have expired. I triggered a new execution of the pipeline so that new documentation are produced: https://github.com/melusina-org/cl-rashell/actions/runs/8605392997

A better way to handle this would be to create a release and attach the documentation to the release.

(BTW What is your interest in Rashell? The define-command macro should have an easier syntax I believe, and it should rely on UIOP or EXTERNAL-PROGRAM. If you have suggestions about this or on other topics, please share them I'm all ears!)

@foretspaisibles foretspaisibles self-assigned this Apr 8, 2024
@svetlyak40wt
Copy link
Author

Thank you! I've read through a manual and this project looks interesting.

It would be wonderful to have some examples in the beginning of the documentation – just to demonstrate how to use the system. For example, how to run a command and retrieve results, how to combine commands together (is it possible to build a pipes?). For example, if I need to find all git repositories in the home folder and to get only repositories having uncommited changes, how should I structure my query using rashell?

@foretspaisibles
Copy link
Collaborator

foretspaisibles commented Apr 11, 2024

It would be wonderful to have some examples in the beginning of the documentation

This is a great idea, I will add some.

is it possible to build a pipes?

It is not possible to do that yet. The main reasons why it is not are:

  • I am not sure yet what an efficient syntax would look like, so I'm happy to hear your opinions if you have some.
  • I am not sure yet if the library should depend on UIOP or EXTERNAL-PROGRAM, none being able to start a program in a specific directory (instead of cwd).

For example, if I need to find all git repositories in the home folder and to get only repositories having uncommited changes, how should I structure my query using rashell?

That really depends on how much logic you want to move in Common Lisp and how much you want to have on the UNIX Shell. You could adapt the following one-liner:

find . -type d -name '.git' -exec sh -c 'repository="${1%/.git}"; git_repository_clean_p () { test -z "$(git status --porcelain)"; }; cd "${repository}"; if ! git_repository_clean_p; then printf "%s\\n" "${repository}"; fi' -- '{}' ';'

Maybe a nicer way would be to first find the repositories and then filter the repositories which are dirty. I am somewhat planning to support git operations in a “rashell/git” system.

BTW The find command above could take very long, maybe check -maxdepth and -mindepth.

@svetlyak40wt
Copy link
Author

Right now I'm using simple-inferiors, which is able to run commands in a specified directory.

For example, here is how I've defined a function to check if repositroy has some uncommited changes:

(defun has-uncommited-changes-p (project)
  (simple-inferiors:with-chdir ((get-staging-dir project))
    (not (str:emptyp (simple-inferiors:run "git" (list "status" "--porcelain=2")
                                       :output :string)))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants