This repository has been archived by the owner on Mar 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* bug: Allow paths with spaces Before this path's with spaces in them did not work, now to path is escaped between "" to make it work. * bug: Make ini files if they don't exist * bug: Made so that values are always defined * bug: Made so that values are always defined
- Loading branch information
1 parent
374d636
commit db3ac5a
Showing
5 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// getVal is a function that takes a gus object, a section, a key, and an index, and returns a string. This function is used to handle when anything is undefined, if so it creates it. | ||
export function getVal(gus: { [key: string]: { [key: string]: Array<string> } }, section: string, key: string, index: number = 0): string { | ||
|
||
if (!gus[section]) { | ||
gus[section] = {}; | ||
} | ||
|
||
if (!gus[section][key]) { | ||
gus[section][key] = []; | ||
} | ||
|
||
if (!gus[section][key][index]) { | ||
gus[section][key][index] = ''; | ||
return gus[section][key][index]; | ||
} | ||
|
||
return gus[section][key][index]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters