pashi icon indicating copy to clipboard operation
pashi copied to clipboard

Add option to permit a css file to be copied to default directories & protected

Open delphidabbler opened this issue 3 years ago • 4 comments

Any file a user edits or copies to the default CSS directory is danger of being overwritten when pashi is updated.

Add a new option, say --install-css that takes the path to a CSS file and copies it to the default directory but also records that it is not to be overwritten. Maybe use a special protected file to list such css files.

This new command would only make sense if it was the only command on the command line - it should run in its own execution context.

delphidabbler avatar Oct 03 '22 07:10 delphidabbler

Don't permit predefined files to be protected directly because this could cause problems with updates.

delphidabbler avatar Oct 03 '22 07:10 delphidabbler

Instead of using a list of protected files another approach might be to place protected files in a subdirectory of the default and search that as well as the default if user doesn't specify a path to a CSS file.

If a file with the same name as a default file is specified then I suppose the one in the protected directory ought to be used.

This could be a solution if the user tries to install a predefined CSS file ... just copy it to the protected folder.

delphidabbler avatar Oct 03 '22 07:10 delphidabbler

Need to decide what to do if user tries to install a file with same name as one already installed.

delphidabbler avatar Oct 15 '22 17:10 delphidabbler

Need to decide what to do if user tries to install a file with same name as one already installed.

How about using prefixes to filenames, a bit like .gitignore does, so that:

  • A normal file name installs the named file unless a file with that name exists when an error is reported & no change is made.
  • Prefixing a & to a file name installs it & overwrites any file with the same name.
  • Prefixing a - to a file name deletes any installed file of that name.
  • Prefixing a ? to a file name displays a message informing whether a file of that name is installed.

delphidabbler avatar Oct 15 '22 21:10 delphidabbler