relsqui / doily

A script for managing daily writing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make a friendlier install process.

relsqui opened this issue · comments

A would-be user should be able to download one thing, run it, and have everything be arranged appropriately for them to be able to just call doily and have it go. Or as close to that as is feasible.

Elly's Make example demonstrates one way to automatically moosh together separate files into one for downloading and unpacking. This could for example be used to build a script that automatically deposits the script and the initial config in their places (obviating the need to check for this in the main script, even).

Where are those places, though?

  • The config file's place is already defined (would have to move that logic over, but an install script is a better place for it anyway).
  • The executable can go in ~/bin for a normal user, but we'd have to instruct the user to put that in their path if it isn't already. No getting around that, though. (Technically we could append to .bash_rc and source it, but that seems a bit invasive.)
  • For a superuser installing systemwide, /usr/local/bin seems to be appropriate for software that's not being managed by the packaging system. Default config in /usr/local/etc I think, but I'm not sure about the plugin hierarchy we're discussing (#11). /usr/local/lib maybe? /usr/lib is mostly C-looking libraries but seems to have some application-specific stuff in there too.

What does the interface look like?

Something along the lines of:

wget github-yadda-yadda/install-doily.sh
bash install-doily.sh

maybe, with an optional --user for installing just for yourself? Or is that that default?

For when I need it, here's a good way to check whether something's in PATH.

Here (adapted from #11) is the proposed directory structure for systemwide install:

/usr/local/
    bin/
        doily
        # The main executable.
    etc/
        doily/
             default.conf
             # The default configuration file.
$HOME/
        # User-specific data and configuration, as below.

I didn't do one yet for local install, but here's a stab at it:

$HOME/
    bin/
        doily
        # The main executable.
    .local/
        share/
            doily/
                dailies/
                    ...
                    # These are already here.
                 plugins/
                     ...
                     # User-specific data for any plugins that need them.
    .config/
        doily/
             doily.conf
             # The user's doily configuration file.
             plugins/
                 ....
                 # Plugin scripts and their configuration files.

Changes from previous version:

  • ~/.local/lib isn't a thing, I made it up because I needed it and I can't find any better ideas.
  • Merged all the plugin stuff into one directory. Will just call the functions I want from whichever ones are enabled; either they do something, or they don't.
  • Added places for plugin-specific configuration and data.

Further edits:

  • Removed systemwide plugins; they're small and personal enough that it's better to let users manage their own than have to poke a sysadmin.
  • Removed local lib for user install, instead putting plugins with configuration (plugins are arguably configuration relative to the main program).
  • Put user config in userspace (for all installs) rather than default (but it'll be initialized from the default on a user-only install).

Completed, save any bugs I haven't found, in 7329931.