MCPcopy Create free account
hub / github.com/dharmaprotocol/dharmaOS / writeActionScriptsToFile

Method writeActionScriptsToFile

src/exporter.js:21–42  ·  view source on GitHub ↗
(actionScripts)

Source from the content-addressed store, hash-verified

19 }
20
21 static async writeActionScriptsToFile(actionScripts) {
22 const buildDir = path.resolve(__dirname, "../build");
23 try {
24 await fs.promises.mkdir(buildDir);
25 } catch (e) {}
26
27 for (const script of actionScripts) {
28 const { name } = script;
29 delete script.variables.wallet;
30 const scriptJSON = JSON.stringify(script, null, 2);
31 fs.writeFile(
32 path.resolve(buildDir, `${name}.json`),
33 scriptJSON,
34 "utf8",
35 (err) => {
36 if (err) {
37 console.error(err);
38 }
39 }
40 );
41 }
42 }
43
44 static async writeTestToFile(actionScriptName, testYAML, category) {
45 const testDir = path.resolve(__dirname, "../action-script-tests");

Callers 2

setActionScriptsMethod · 0.80
setActionScriptMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected