1
0
Fork 0

Avoid awk on macOS

I was hoping they'd have gawk installed, but I guess not.
This commit is contained in:
Robbert van der Helm 2022-02-16 13:34:20 +01:00
parent 9b41017f36
commit c5c966c0cc
2 changed files with 16 additions and 1 deletions

View file

@ -107,7 +107,7 @@ jobs:
# Instead of hardcoding which targets to build and package, we'll # Instead of hardcoding which targets to build and package, we'll
# package everything that's got en entry in the `bundler.toml` file # package everything that's got en entry in the `bundler.toml` file
run: | run: |
packages=$(awk 'match($0, /^\s*\["?([^"]+)"?]/, matches) { print matches[1] }' bundler.toml) packages=$(cargo xtask known-packages)
for package in $packages; do for package in $packages; do
cargo xtask bundle "$package" --bundle-vst3 --release cargo xtask bundle "$package" --bundle-vst3 --release
done done

View file

@ -37,6 +37,9 @@ fn main() -> Result<()> {
bundle(&package, other_args) bundle(&package, other_args)
} }
// This is only meant to be used by the CI, since using awk for this can be a bit spotty on
// macOS
"known-packages" => list_known_packages(),
_ => bail!("Unknown command '{command}'\n\n{USAGE_STRING}"), _ => bail!("Unknown command '{command}'\n\n{USAGE_STRING}"),
} }
} }
@ -124,6 +127,18 @@ fn bundle(package: &str, mut args: Vec<String>) -> Result<()> {
Ok(()) Ok(())
} }
/// This lists the packages configured in `bundler.toml`. This is only used as part of the CI when
/// bundling plugins.
fn list_known_packages() -> Result<()> {
if let Some(config) = load_bundler_config()? {
for package in config.keys() {
println!("{package}");
}
}
Ok(())
}
/// Load the `bundler.toml` file, if it exists. If it does exist but it cannot be parsed, then this /// Load the `bundler.toml` file, if it exists. If it does exist but it cannot be parsed, then this
/// will return an error. /// will return an error.
fn load_bundler_config() -> Result<Option<BundlerConfig>> { fn load_bundler_config() -> Result<Option<BundlerConfig>> {