Commit graph

30 commits

Author SHA1 Message Date
Christina Sørensen
e29cfa4866
sec: removed atty dependency
Cherry-picked from dev branch.

Updated pretty-env-logger to 0.5.0, as it was pulling atty which has a
potential security vulnerability, and further has been unmaintained and
unresponsive for 3 years.

https://github.com/advisories/GHSA-g98v-hv3f-hcfr

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-07-02 07:45:04 +02:00
Christina Sørensen
90dfeb985a
fix: changed config.yaml location
Recent merge moved the location.

see: d61a46d4e5
2023-06-18 18:06:44 +00:00
Christina Sørensen
0739873dcc
feat: added nix flake #5
changelog:
- Refactor: Fixed various clippy errors
- Refactor: Fixed various clippy errors
- WIP: mvp flake working
- refactor: removed unused code from flake
- refactor: improved GitRepo assoc. function debug
- test: removed unused ./test dir
- refactor: removed redundant line in Cargo.toml
- chore: version bump to v0.0.3
2023-06-18 18:02:36 +00:00
Christina Sørensen
097e6fd798
chore: version bump to v0.0.3
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-06-18 19:57:13 +02:00
Christina Sørensen
30fe7943f1
refactor: removed redundant line in Cargo.toml
We only need one of license or license-file, so license-file was
removed.

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-06-18 19:56:51 +02:00
Christina Sørensen
d61a46d4e5
test: removed unused ./test dir
The test dir was already copied into ./src/test, and this was redundant.

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-06-18 19:44:45 +02:00
Christina Sørensen
5e974e213d
refactor: improved GitRepo assoc. function debug
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>
2023-06-18 19:39:50 +02:00
Christina Sørensen
cab7f72e28
refactor: removed unused code from flake
Most of this was introduced during the process of getting the flake to
work.

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-06-18 19:34:51 +02:00
Christina Sørensen
551c406591
WIP: mvp flake working
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>
2023-06-17 14:11:42 +02:00
Christina Sørensen
ce2ceee129
feat: started flakification
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`.
2023-06-14 18:52:02 +02:00
Christina Sørensen
a9abc4fed5
Refactor: Fixed various clippy errors
It should be self evident from the diff what was changed and why.

This is to prepare for the flake-ification of the project.
2023-06-14 18:38:11 +02:00
Christina Sørensen
c507379f25
Added default to quick() in main #3
Added a default case to quick in main (quickcommit).
2023-06-12 11:54:58 +00:00
Christina Sørensen
1cc7f7a1ae
Added default to quick() in main
Added a default case to quick in main (quickcommit).

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-06-12 13:52:58 +02:00
Christina Sørensen
9182d4f236
Merge pull request #2 from cafkafk/dev
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.
2023-06-11 10:58:50 +00:00
Christina Sørensen
4a04b45b7b
Refactored Links::link implementation
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>
2023-06-11 12:54:14 +02:00
Christina Sørensen
c4f1543306
Merge pull request #1 from cafkafk/dev
License and license related flags
2023-06-09 16:36:30 +00:00
Christina Sørensen
696eacf8d7
bump to V0.0.2: license to license
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>
2023-06-09 18:31:22 +02:00
Christina Sørensen
0f7b525a55
Made -h, --help show license notice
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>
2023-06-09 18:28:19 +02:00
Christina Sørensen
c38b524e09
Finalized license, warranty flags
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>
2023-06-09 18:16:28 +02:00
Christina Sørensen
c8ea855451
Implemented the flag arms for license, warranty
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>
2023-06-09 18:14:06 +02:00
Christina Sørensen
3e3566ea3c
Made utils/strings consts public
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>
2023-06-09 17:30:42 +02:00
Christina Sørensen
db6e905cbc
Added arm to match statement for waranty in main
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>
2023-06-09 17:25:15 +02:00
Christina Sørensen
65190b8752
Decided to go for a glass of water
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>
2023-06-09 16:26:58 +02:00
Christina Sørensen
9bbabb9367
Added --warranty flag, typos
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>
2023-06-09 16:25:25 +02:00
Christina Sørensen
661b730c44
Added licensing string constants to utils/strings
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>
2023-06-09 16:22:04 +02:00
Christina Sørensen
7c7d9f6129
Added GPLv3 header to files in src/
This is what the GPLv3 recommends, as can be referred in the LICENSE
file.

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-06-09 16:09:32 +02:00
Christina Sørensen
e8dd2b177c
Init utils/strings module
For keeping longer text output helpers, such as e.g. license text and
CoC.

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-06-09 16:01:26 +02:00
Christina Sørensen
7217c1cbfa
Removed commented out code in main.rs
For some reason, the match arm for --quick had only been commented out.
Now it's removed.

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2023-06-09 15:57:34 +02:00
Christina Sørensen
eb92038fbf
Refactored GitRepo associated functions
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>
2023-06-09 14:51:24 +02:00
Christina Sørensen
82089f213e
initial commit
History was reset for the first public release,
as the standard of commit messages would have set
a bad example...
2023-06-08 18:50:09 +02:00