Skip to content

Commit 10c64a3

Browse files
committed
Slight change to the default lock file location
Previously the lock file path defaulted to the config file location but with a `.lock` extension. It now defaults to `<root>/plugins.lock` regardless of the config file location.
1 parent ae447a3 commit 10c64a3

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Sheldon accepts the following global command line options.
328328
|`--home <path>`|`HOME`|Set the home directory. (*default:* auto)|
329329
|`--root <path>`|`SHELDON_ROOT`|Set the root directory. (*default:* `<home>/.sheldon`)|
330330
|`--config-file <path>`|`SHELDON_CONFIG_FILE`|Set the config file. (*default:* `<root>/plugins.toml`)|
331-
|`--lock-file <path>`|`SHELDON_LOCK_FILE`|Set the lock file. (*default:* `<config-file>.lock`)|
331+
|`--lock-file <path>`|`SHELDON_LOCK_FILE`|Set the lock file. (*default:* `<root>/plugins.lock`)|
332332
|`--clone-dir <path>`|`SHELDON_CLONE_DIR`|Set the clone directory. (*default:* `<root>/repos`)|
333333
|`--download-dir <path>`|`SHELDON_DOWNLOAD_DIR`|Set the download directory. (*default:* `<root>/downloads`)|
334334

docs/src/Command-line-interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Sheldon accepts the following global command line options.
131131
| `--home <path>` | `HOME` | Set the home directory. (*default:* auto) |
132132
| `--root <path>` | `SHELDON_ROOT` | Set the root directory. (*default:* `<home>/.sheldon`) |
133133
| `--config-file <path>` | `SHELDON_CONFIG_FILE` | Set the config file. (*default:* `<root>/plugins.toml`) |
134-
| `--lock-file <path>` | `SHELDON_LOCK_FILE` | Set the lock file. (*default:* `<config-file>.lock`) |
134+
| `--lock-file <path>` | `SHELDON_LOCK_FILE` | Set the lock file. (*default:* `<root>/plugins.lock`) |
135135
| `--clone-dir <path>` | `SHELDON_CLONE_DIR` | Set the clone directory. (*default:* `<root>/repos`) |
136136
| `--download-dir <path>` | `SHELDON_DOWNLOAD_DIR` | Set the download directory. (*default:* `<root>/downloads`) |
137137

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ impl Opt {
333333
};
334334
let root = root.unwrap_or_else(|| home.join(".sheldon"));
335335
let config_file = config_file.unwrap_or_else(|| root.join("plugins.toml"));
336-
let lock_file = lock_file.unwrap_or_else(|| config_file.with_extension("lock"));
336+
let lock_file = lock_file.unwrap_or_else(|| root.join("plugins.lock"));
337337
let clone_dir = clone_dir.unwrap_or_else(|| root.join("repos"));
338338
let download_dir = download_dir.unwrap_or_else(|| root.join("downloads"));
339339

tests/cases/override_config_file

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# test.toml
22

3-
# test.lock
3+
# plugins.lock
44
version = "<version>"
55
home = "<root>"
66
root = "<root>"
77
config_file = "<root>/test.toml"
8-
lock_file = "<root>/test.lock"
8+
lock_file = "<root>/plugins.lock"
99
clone_dir = "<root>/repos"
1010
download_dir = "<root>/downloads"
1111
plugins = []
@@ -29,11 +29,11 @@ each = true
2929

3030
# lock.stderr
3131
[LOADED] ~/test.toml
32-
[LOCKED] ~/test.lock
32+
[LOCKED] ~/plugins.lock
3333

3434
# source.stdout
3535

3636
# source.stderr
37-
[UNLOCKED] ~/test.lock
37+
[UNLOCKED] ~/plugins.lock
3838

3939
# end

tests/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ fn lock_and_source_override_config_file() -> io::Result<()> {
473473
.arg("source")
474474
.run()?;
475475

476-
case.assert_contents("test.lock")
476+
case.assert_contents("plugins.lock")
477477
}
478478

479479
#[test]

0 commit comments

Comments
 (0)