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]
crs = "https://github.com/crystal-linux/%repo%"
pkg = "https://github.com/crystal-linux/pkgbuild.%repo%"
crs = "https://github.com/crystal-linux/{}"
pkg = "https://github.com/crystal-linux/pkgbuild.{}"

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

@ -81,7 +81,7 @@ pub fn parse_cfg(verbose: bool) -> Config {
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
let priority = &split_struct.name.matches('!').count();

@ -14,31 +14,30 @@ mode = ""
smart_pull = true
[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 = ""
# Only required when in repository mode, decides whether to PGP sign built packages
sign = true
# Only required when in repository mode, decides whether to build packages if pull is successful
# Decides whether to build packages if package repo is updated on pull
build_on_update = false
[mode.repository.signing]
# Decides whether or not to sign packages
enabled = true
[mode.workspace]
# There are currently no options for workspace mode
[repositories]
# An array of Git repositories to clone from, formatted url_index::repo_name(!)
# e.g. if you had URLs = [ "https://example.com/%repo%.git" ], 1::package would expand to https://example.com/package.git
# 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.
name = [
"",
""
# List of repositories formatted as id:name (priority is decided by the ! suffix, and decides package build order)
repos = [
"aur:hello!",
"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)
urls = [
"",
""
]"#;
[repositories.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) {
// Ensure current directory is empty
if env::current_dir()

Loading…
Cancel
Save