Skip to content

Commit

Permalink
Merge pull request #2 from kianmeng/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
hudson-newey authored Dec 27, 2024
2 parents 414d078 + 9c261c5 commit a6181d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A wrapper for the "rm" command with soft-deletes, config-based deletion, debug i

## "GNU Like" command line arguments

- `-i` Interactivly prompt before each deletion request
- `-i` Interactively prompt before each deletion request
- `-I` Prompt if deleting more than the interactive threshold of files (default 3)
- `-r`, `-R`, `--recursive` Recursively delete a directory of files
- `-v`, `--verbose` Emit additional verbose information
Expand Down Expand Up @@ -35,7 +35,7 @@ A wrapper for the "rm" command with soft-deletes, config-based deletion, debug i

### Removes the ability to remove your root directory

I have done this so that you can't accidently add a space and remove your root directory with a typo such as
I have done this so that you can't accidentally add a space and remove your root directory with a typo such as

```sh
$ rm -rf ./directory /
Expand Down Expand Up @@ -63,9 +63,9 @@ In this case, you can modify your `~/.local/share/2rm/config.yml` file to always

### Overwriting disk location with zeros

When deleting a file with the linux inbuilt `rm` command, the file is still avaliable on disk.
When deleting a file with the linux inbuilt `rm` command, the file is still available on disk.

Meaning that the file can still be recovered by any sufficiantly technical user.
Meaning that the file can still be recovered by any sufficiently technical user.

This can be problematic when dealing with sensitive files such as private keys that if leaked could lead to catastrophic consequences.

Expand Down
6 changes: 3 additions & 3 deletions src/patches/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func RmPatch(arguments []string, config models.Config) {
}

func removeDangerousArguments(arguments []string) []string {
// I have excluded the root slash as a forbidden argument just incase
// I have excluded the root slash as a forbidden argument just in case
// you make a typo like rm ./myDirectory /
// when you were just trying to delete myDirectory
forbiddenArguments := []string{"/", "--no-preserve-root"}
Expand Down Expand Up @@ -105,10 +105,10 @@ func deletePaths(paths []string, config models.Config, arguments []string) {
silent := util.InArray(arguments, cli.SILENT_CLA)
dryRun := util.InArray(arguments, cli.DRY_RUN_CLA)

hasInteraciveCla := util.InArray(arguments, cli.INTERACTIVE_CLA)
hasInteractiveCla := util.InArray(arguments, cli.INTERACTIVE_CLA)
hasGroupInteractiveCla := util.InArray(arguments, cli.INTERACTIVE_GROUP_CLA)
isInteractiveGroup := hasGroupInteractiveCla && len(paths) >= config.InteractiveThreshold()
isInteractive := hasInteraciveCla || isInteractiveGroup
isInteractive := hasInteractiveCla || isInteractiveGroup

onlyEmptyDirs := util.InArray(arguments, cli.DIR_CLA)
if !onlyEmptyDirs {
Expand Down

0 comments on commit a6181d1

Please sign in to comment.