@@ -21,21 +21,20 @@ const sendFile = async (urlPath, data) => {
|
||||
}
|
||||
};
|
||||
|
||||
// Get system utils
|
||||
execSync("apt update", { encoding: "utf8" });
|
||||
execSync("apt install -y pipx", { encoding: "utf8" });
|
||||
execSync("pipx install mpy-cross", { encoding: "utf8" });
|
||||
const doIt = async () => {
|
||||
// Get system utils
|
||||
execSync("apt update", { encoding: "utf8" });
|
||||
execSync("apt install -y pipx", { encoding: "utf8" });
|
||||
execSync("pipx install mpy-cross", { encoding: "utf8" });
|
||||
|
||||
// Add base lib file to repo
|
||||
await sendFile(`__init__.mpy`, new ArrayBuffer(0));
|
||||
// Add base lib file to repo
|
||||
await sendFile(`__init__.mpy`, new ArrayBuffer(0));
|
||||
|
||||
// Update urls
|
||||
packageJsonUrls.push([`${libName}/__init__.mpy`, "__init__.mpy"]);
|
||||
// Update urls
|
||||
packageJsonUrls.push([`${libName}/__init__.mpy`, "__init__.mpy"]);
|
||||
|
||||
// Generate module folders/files
|
||||
readdirSync(".")
|
||||
.filter((f) => f.slice(-2) == "py")
|
||||
.forEach(async (moduleFile) => {
|
||||
// Generate module folders/files
|
||||
for (let moduleFile of readdirSync(".").filter((f) => f.slice(-2) == "py")) {
|
||||
const modName = moduleFile.slice(0, -3);
|
||||
const modInitPath = `${modName}/__init__.mpy`;
|
||||
const modPyPath = `${modName}.mpy`;
|
||||
@@ -52,16 +51,19 @@ readdirSync(".")
|
||||
console.log("FARTS");
|
||||
packageJsonUrls.push([`${libName}/${modInitPath}`, "__init__.mpy"]);
|
||||
packageJsonUrls.push([`${libName}/${modName}/${modPyPath}`, modPyPath]);
|
||||
});
|
||||
}
|
||||
|
||||
console.log(packageJsonUrls);
|
||||
console.log(packageJsonUrls);
|
||||
|
||||
// Add package.json to repo
|
||||
await sendFile(
|
||||
// Add package.json to repo
|
||||
await sendFile(
|
||||
`package.json`,
|
||||
JSON.stringify({
|
||||
urls: packageJsonUrls,
|
||||
deps: [],
|
||||
version: version,
|
||||
}),
|
||||
);
|
||||
);
|
||||
};
|
||||
|
||||
doIt();
|
||||
|
||||
Reference in New Issue
Block a user