Skip to content

Commit 34d2939

Browse files
committed
Added Windows and Unix-specific starter config files.
1 parent 818fb24 commit 34d2939

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "config-loader"
3-
version = "2.2.2"
3+
version = "2.2.3"
44
authors = ["Zacchary Dempsey-Plante <[email protected]>"]
55
edition = "2021"
66
license = "MIT OR Apache-2.0"

src/app.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ use super::{HEADER_STYLE, INPUT_STYLE, MESSAGE_STYLE, RESULT_STYLE, VALUE_STYLE}
2727
use crate::ERROR_STYLE;
2828

2929
// Constants
30-
const STARTER_CONFIG_CONTENTS: &str = include_str!("../static/starter-loadouts-config.toml");
30+
#[cfg(windows)]
31+
const STARTER_CONFIG_CONTENTS: &str =
32+
include_str!("../static/starter-loadouts-config-windows.toml");
33+
#[cfg(not(windows))]
34+
const STARTER_CONFIG_CONTENTS: &str = include_str!("../static/starter-loadouts-config-unix.toml");
3135

3236
// Type Definitions
3337
type LoadoutName = String;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Config Loader - https://github.com/zedseven/config-loader
2+
3+
# Here's where you define the file targets. These are the files you
4+
# have to switch out whenever you want to change to a different configuration.
5+
# Please use absolute file paths.
6+
[targets]
7+
target_name = "/some/file/path.ext"
8+
another_target_name = "/some/other/file/path.ext"
9+
10+
# Here's where each loadout is defined. Include as many files for each loadout
11+
# as you need.
12+
# Each loadout is completely separate from the others. Each one should be a
13+
# complete set of all the files necessary to work.
14+
[[loadouts]]
15+
name = "Some Loadout Name A"
16+
[loadouts.files]
17+
target_name = "/some/file/for/loadout/a.ext"
18+
19+
[[loadouts]]
20+
name = "Some Loadout Name B"
21+
[loadouts.files]
22+
target_name = "/some/file/for/loadout/b.ext"
23+
another_target_name = "/some/other/file/for/loadout/b.ext"

static/starter-loadouts-config.toml renamed to static/starter-loadouts-config-windows.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
# Here's where you define the file targets. These are the files you
44
# have to switch out whenever you want to change to a different configuration.
55
# Please use absolute file paths.
6+
# If you're copying the file paths from somewhere in Windows, you need to make sure backslashes '\' are doubled-up: '\\'
7+
# You can also use forward slashes, which don't need to be doubled-up: '/'
68
[targets]
79
target_name = "C:\\Some\\File\\Path.ext"
8-
another_target_name = "C:\\Some\\Other\\File\\Path.ext"
10+
another_target_name = "C:/Some/Other/File/Path.ext"
911

1012
# Here's where each loadout is defined. Include as many files for each loadout
1113
# as you need.
@@ -19,5 +21,5 @@ target_name = "C:\\Some\\File\\For\\Loadout\\A.ext"
1921
[[loadouts]]
2022
name = "Some Loadout Name B"
2123
[loadouts.files]
22-
target_name = "C:\\Some\\File\\For\\Loadout\\B.ext"
24+
target_name = "C:/Some/File/For/Loadout/B.ext"
2325
another_target_name = "C:\\Some\\Other\\File\\For\\Loadout\\B.ext"

0 commit comments

Comments
 (0)