Skip to content

Commit

Permalink
Added Windows and Unix-specific starter config files.
Browse files Browse the repository at this point in the history
  • Loading branch information
zedseven committed Dec 16, 2021
1 parent 818fb24 commit 34d2939
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "config-loader"
version = "2.2.2"
version = "2.2.3"
authors = ["Zacchary Dempsey-Plante <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
6 changes: 5 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ use super::{HEADER_STYLE, INPUT_STYLE, MESSAGE_STYLE, RESULT_STYLE, VALUE_STYLE}
use crate::ERROR_STYLE;

// Constants
const STARTER_CONFIG_CONTENTS: &str = include_str!("../static/starter-loadouts-config.toml");
#[cfg(windows)]
const STARTER_CONFIG_CONTENTS: &str =
include_str!("../static/starter-loadouts-config-windows.toml");
#[cfg(not(windows))]
const STARTER_CONFIG_CONTENTS: &str = include_str!("../static/starter-loadouts-config-unix.toml");

// Type Definitions
type LoadoutName = String;
Expand Down
23 changes: 23 additions & 0 deletions static/starter-loadouts-config-unix.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Config Loader - https://github.com/zedseven/config-loader

# Here's where you define the file targets. These are the files you
# have to switch out whenever you want to change to a different configuration.
# Please use absolute file paths.
[targets]
target_name = "/some/file/path.ext"
another_target_name = "/some/other/file/path.ext"

# Here's where each loadout is defined. Include as many files for each loadout
# as you need.
# Each loadout is completely separate from the others. Each one should be a
# complete set of all the files necessary to work.
[[loadouts]]
name = "Some Loadout Name A"
[loadouts.files]
target_name = "/some/file/for/loadout/a.ext"

[[loadouts]]
name = "Some Loadout Name B"
[loadouts.files]
target_name = "/some/file/for/loadout/b.ext"
another_target_name = "/some/other/file/for/loadout/b.ext"
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# Here's where you define the file targets. These are the files you
# have to switch out whenever you want to change to a different configuration.
# Please use absolute file paths.
# If you're copying the file paths from somewhere in Windows, you need to make sure backslashes '\' are doubled-up: '\\'
# You can also use forward slashes, which don't need to be doubled-up: '/'
[targets]
target_name = "C:\\Some\\File\\Path.ext"
another_target_name = "C:\\Some\\Other\\File\\Path.ext"
another_target_name = "C:/Some/Other/File/Path.ext"

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

0 comments on commit 34d2939

Please sign in to comment.