Files
wlan-ucentral-schema/system/package_list.uc
Kumiko18 985f3cbaf1 WIFI-14588: Cloud Package Manager
FIX MISSING SEMICOLON

Signed-off-by: Kumiko18 <alex18_huang@accton.com>
2025-06-30 06:13:28 +00:00

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});