unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Wojtek Kosior via <help-guix@gnu.org>
To: Peter Polidoro <peter@polidoro.io>
Cc: zimoun <zimon.toutoune@gmail.com>, "(" <paren@disroot.org>,
	help-guix@gnu.org
Subject: Re: Using Makefile to run guix shell?
Date: Mon, 12 Dec 2022 20:00:22 +0100	[thread overview]
Message-ID: <20221212200022.64024016.koszko@koszko.org> (raw)
In-Reply-To: <87zgbs5vsi.fsf@polidoro.io>

[-- Attachment #1: Type: text/plain, Size: 3151 bytes --]

> > So the true question is how to implement?  If using Shell script  
> 
> Using shell scripts would mean one script per command? I usually 
> have a set of commands that I would like to be able to run for 
> every project. I would like to minimize the number of extra files 
> in my project directory, so I would lean towards your Scheme API 
> option.

There's nothing that stops a shell script from exposing multiple
commands. Consider for example the SysV init scripts. They typically
utilize the `case` statement to support commands like "start", "stop",
"status", etc.

So you could craft a solution where from the root of your project you
can run `./my-script.sh command1`, `./my-script.sh command2`, etc.

Also, you mentioned you "would like to minimize the number of extra
files" in your "project directory". Does that mean you don't actually
mind creating more files in a *subdirectory* thereof? If you don't, how
about putting command scripts under, say, `my-scripts/` and running
them as `my-scripts/command1.sh`, `my-scripts/command2.sh`, etc.?

Wojtek

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

Meet Kraków saints!           #25: blessed Maksymilian Binkiewicz
Poznaj świętych krakowskich!  #25: błogosławiony Maksymilian Binkiewicz
https://pl.wikipedia.org/wiki/Maksymilian_Binkiewicz
-- (sig_end)


On Mon, 12 Dec 2022 12:55:39 -0500
Peter Polidoro <peter@polidoro.io> wrote:

> zimoun <zimon.toutoune@gmail.com> writes:
> 
> > Because calling “guix serial-shell PORT=/dev/ttyUSB0” or
> > “guix-serial-shell PORT=/dev/ttyUSB0” is almost identical. :-)  
> 
> Yes good point.
> 
> >
> > So the true question is how to implement?  If using Shell script  
> 
> Using shell scripts would mean one script per command? I usually 
> have a set of commands that I would like to be able to run for 
> every project. I would like to minimize the number of extra files 
> in my project directory, so I would lean towards your Scheme API 
> option.
> 
> > From my point of view, in this case, maybe an extension is a 
> > heavy
> > solution when a quick script would just smooth the workflow.  
> 
> Maybe it is too heavy a solution, but I do like the idea of just 
> needing the channels.scm, the guix.scm, and maybe a Makefile for 
> people who do not use guix. Or am I wrong and I would need more 
> files than that?
> 
> I also like that a user could find information about the project 
> commands using guix help. Can command extensions be grouped into a 
> single sub-command so I would not feel like I am polluting the 
> guix command namespace? Like could I run something like "guix 
> project serial-shell PORT=/dev/ttyUSB0" or "guix project help" to 
> get the set of project-specific commands that I added as 
> extensions?
> 
> Is there some sort of extension bootstrap process where you run an 
> intial command in the project directory every session to add the 
> extensions, then the extensions are available for future commands?



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2022-12-12 19:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 14:47 Using Makefile to run guix shell? Peter Polidoro
2022-12-07 15:12 ` (
2022-12-07 15:26   ` Peter Polidoro
2022-12-07 15:38     ` (
2022-12-07 18:27       ` Peter Polidoro
2022-12-07 21:01         ` Wojtek Kosior via
2022-12-08 10:44         ` zimoun
2022-12-08 14:21           ` Peter Polidoro
2022-12-08 15:30             ` Wojtek Kosior via
2022-12-08 18:47             ` zimoun
2022-12-08 21:30               ` Wojtek Kosior via
2022-12-08 23:04                 ` zimoun
2022-12-08 23:24                   ` Wojtek Kosior via
2022-12-09 17:46                   ` Peter Polidoro
2022-12-10 13:21                     ` zimoun
2022-12-12 17:55                       ` Peter Polidoro
2022-12-12 19:00                         ` Wojtek Kosior via [this message]
2022-12-09 18:38     ` Philip McGrath
2022-12-07 17:08 ` Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221212200022.64024016.koszko@koszko.org \
    --to=help-guix@gnu.org \
    --cc=koszko@koszko.org \
    --cc=paren@disroot.org \
    --cc=peter@polidoro.io \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).