mirror of
https://github.com/Telecominfraproject/wlan-ucentral-schema.git
synced 2026-01-27 18:23:32 +00:00
23 lines
464 B
Ucode
Executable File
23 lines
464 B
Ucode
Executable File
#!/usr/bin/ucode
|
|
|
|
import * as fs from 'fs';
|
|
|
|
let package_json = [];
|
|
|
|
let fd = fs.open("/tmp/packages.state", "r");
|
|
if (fd) {
|
|
let line;
|
|
while (line = fd.read("line")) {
|
|
let tokens = split(line, " - ");
|
|
|
|
if (length(tokens) < 2) {
|
|
continue;
|
|
}
|
|
|
|
push(package_json, {"name": tokens[0], "version": replace(tokens[1], "\n", "")});
|
|
}
|
|
fd.close();
|
|
}
|
|
|
|
fs.writefile('/tmp/packages.json', {"packages": package_json});
|