Made the GitRepo associated functions easier to debug, by providing
additional output of the struct when running the git command on the repo
fails.
Also removed commented out code in main.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This still has an issue, because tests cannot run with network inside of
the flake.
When this is solved, the code just needs to be refactored and it's
ready.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
The flake is still not fully functional.
First, it seems nescesarry to get a solid system for relative paths,
so that we can run tests inside of a nix build.
To iterate on this, use `nix flake check`.
Refactored Links::link implementation to be able to deal with several possible scenarios:
file already linked (happy case)
link to different file exists
non link file exists
broken symlink exists
no file exists (happy case)
generic failure
Also attempted to make the code more readable than previous attempt. Admittedly, still needs some work.
Refactored Links::link implementation to be able to deal with
several possible scenarios:
- file already linked (happy case)
- link to different file exists
- non link file exists
- broken symlink exists
- no file exists (happy case)
- generic failure
Also attempted to make the code more readable than previous attempt.
Admittedly, still needs some work.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Added licenses to files in src.
Implemented flags:
- warranty
- license
Added license notice to help.
Refactored parts of the code.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Moved the help template into its own const, and concatenated it with the
interactive notice to append it to the help output.
Also, adjusted the license, warranty, and notice strings for increased
readability.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Made the clap Parser able to be run without a subcommand, by wrapping
the subcommand field of the Parser struct in an Option<Command>.
Further destructured the subcommand arms fields in main with Some(),
and made the default case None just return ().
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Implemented the flag arms for license, warranty in main,
but this will not work before we make the clap Parser able
to be run without a subcommand, by wrapping the subcommand
field of the Parser struct in an Option<Command>.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Made the following utils/strings consts public
- INTERACTIVE_NOTICE
- INTERACTIVE_LICENSE
- INTERACTIVE_WARRANTY
This is to allow their use in the flags match in main.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Added an arm to the match statement for parsing flags in main.
Using the pattern and hopefully ongoing convention of making
unimplemented arms indicated by using the unimplemented!() macro.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
My room temperature is approaching that of my processor.
Hydrating is very important, in order to keep myself in peak shape for
coding, I took a tactical water break.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Added the --warranty flag.
Removed part of docstring that said the --license would give full-text.
This is wrong, as will be implementing the shorter notice.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Added these three constants to utils/strings:
- INTERACTIVE_NOTICE
- INTERACTIVE_LICENSE
- INTERACTIVE_WARRANTY
These were based of the license text's notices for interactive programs,
found in the "How to Apply These Terms to Your New Programs" section.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Strings representing where to run commands where one of:
.current_dir(&(self.path.to_owned() + &self.name))
.current_dir(format!("{}{}", &self.path, &self.name))
Decided to change all instances to the latter, as asking people seemed
to prefer it for readability.
Signed-off-by: Christina Sørensen <christina@cafkafk.com>