flyingcircusio / appenv

Self-contained bootstrapping/updating of Python applications deployed through shared repositories
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Provide appenv as separate script with symlinks #22

Closed ctheune closed 3 years ago

ctheune commented 3 years ago

Looking at the confusion between batou and appenv I suggest we implement a new scheme where appenv becomes its own script and the actual (managed) utilities are symlinks (so that appenv determines which script to run by looking at the argv[0]) by which it was called. This removes the need for a "meta" argument parser:

ctheune@fourteen-3 /tmp/asdf $ ls -lah
total 0
drwxr-xr-x    4 ctheune  wheel   128B Feb 23 06:54 .
drwxrwxrwt  494 root     wheel    15K Feb 23 06:54 ..
-rw-r--r--    1 ctheune  wheel     0B Feb 23 06:54 appenv
lrwxr-xr-x    1 ctheune  wheel     6B Feb 23 06:54 batou -> appenv

This also means we can easily add more symlinks, think harder about updating appenv itself and maybe providing it as a real, versioned package instead of just a curl'ed file.

ctheune commented 3 years ago

If we want to make it flexible what the name of appenv is, we can determine whether we're talking to appenv vs. using appenv by simply checking whether arvg0 is a symlink instead of a real file.