MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / run

Function run

chirpstack/src/cmd/import_device_profiles.rs:117–138  ·  view source on GitHub ↗
(dir: &Path)

Source from the content-addressed store, hash-verified

115}
116
117pub async fn run(dir: &Path) -> Result<()> {
118 storage::setup().await?;
119 info!(path = ?dir, "Import LoRaWAN device profiles");
120
121 let vendors_dir = dir.join("vendors");
122 let vendors = fs::read_dir(vendors_dir)?;
123
124 for vendor in vendors.flatten() {
125 if vendor.file_name() == "example-vendor" {
126 continue;
127 }
128
129 let span = span!(Level::INFO, "", vendor = ?vendor.file_name());
130
131 let vendor_dir = vendor.path();
132 if vendor_dir.is_dir() {
133 handle_vendor(&vendor_dir).instrument(span).await?;
134 }
135 }
136
137 Ok(())
138}
139
140async fn handle_vendor(dir: &Path) -> Result<()> {
141 let vendor_conf = dir.join("vendor.toml");

Callers

nothing calls this directly

Calls 2

handle_vendorFunction · 0.85
setupFunction · 0.50

Tested by

no test coverage detected