New config represented in `config` command, replaced %repo% with {}

main
Michal 2 years ago
parent 9e7daf8aa2
commit a2bafebcfb
No known key found for this signature in database
GPG Key ID: A6A1A4DCB22279B9

@ -20,5 +20,5 @@ repos = [
] ]
[repositories.urls] [repositories.urls]
crs = "https://github.com/crystal-linux/%repo%" crs = "https://github.com/crystal-linux/{}"
pkg = "https://github.com/crystal-linux/pkgbuild.%repo%" pkg = "https://github.com/crystal-linux/pkgbuild.{}"

@ -22,6 +22,6 @@ repos = [
] ]
[repositories.urls] [repositories.urls]
crs = "https://github.com/crystal-linux/%repo%" crs = "https://github.com/crystal-linux/{}"
aur = "https://aur.archlinux.org/%repo%" aur = "https://aur.archlinux.org/{}"
nms = "https://github.com/not-my-segfault/%repo%" nms = "https://github.com/not-my-segfault/{}"

@ -81,7 +81,7 @@ pub fn parse_cfg(verbose: bool) -> Config {
urls_vec.push(url); urls_vec.push(url);
} }
} }
let url = urls_vec[0].replace("%repo%", &name); let url = urls_vec[0].replace("{}", &name);
// Counts instances of ! in the name, and totals a priority accordingly // Counts instances of ! in the name, and totals a priority accordingly
let priority = &split_struct.name.matches('!').count(); let priority = &split_struct.name.matches('!').count();

@ -14,31 +14,30 @@ mode = ""
smart_pull = true smart_pull = true
[mode.repository] [mode.repository]
# Only required when in repository mode, decides what to call the repository and relevant files # Decides what to call the repository and relevant files
name = "" name = ""
# Only required when in repository mode, decides whether to PGP sign built packages # Decides whether to build packages if package repo is updated on pull
sign = true
# Only required when in repository mode, decides whether to build packages if pull is successful
build_on_update = false build_on_update = false
[mode.repository.signing]
# Decides whether or not to sign packages
enabled = true
[mode.workspace] [mode.workspace]
# There are currently no options for workspace mode # There are currently no options for workspace mode
[repositories] [repositories]
# An array of Git repositories to clone from, formatted url_index::repo_name(!) # List of repositories formatted as id:name (priority is decided by the ! suffix, and decides package build order)
# e.g. if you had URLs = [ "https://example.com/%repo%.git" ], 1::package would expand to https://example.com/package.git repos = [
# Repository mode only: Depending on the number of "!"s appended to the name, the priority of the package will be determined. More "!"s = higher priority = built first. "aur:hello!",
name = [ "crs:malachite"
"",
""
] ]
# An array of URLs to clone from, in the format https://example.com/%repo% (the %repo% is NOT optional and will be replaced with the name of the repository) [repositories.urls]
urls = [ # URL keys for repositories, with {} where the repository name would go
"", crs = "https://github.com/crystal-linux/{}"
"" aur = "https://aur.archlinux.org/{}"
]"#; "#;
pub fn create(verbose: bool) { pub fn create(verbose: bool) {
// Ensure current directory is empty // Ensure current directory is empty
if env::current_dir() if env::current_dir()

Loading…
Cancel
Save