]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blob - example/iot-gateway/node_modules/long/scripts/build.js
Initial commit
[apps/tidep0084.git] / example / iot-gateway / node_modules / long / scripts / build.js
1 var MetaScript = require("metascript"),
2     path = require("path"),
3     fs = require("fs");
5 var rootDir = path.join(__dirname, ".."),
6     srcDir = path.join(__dirname, "..", "src"),
7     distDir = path.join(__dirname, "..", "dist"),
8     pkg = require(path.join(rootDir, "package.json")),
9     filename;
11 var scope = {};
13 // Build
14 console.log("Building long.js with scope", JSON.stringify(scope, null, 2));
15 fs.writeFileSync(
16     path.join(distDir, "long.js"),
17     MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "wrap.js")), filename, scope, srcDir)
18 );
20 // Update bower.json
21 scope = { VERSION: pkg.version };
22 console.log("Updating bower.json with scope", JSON.stringify(scope, null, 2));
23 fs.writeFileSync(
24     path.join(rootDir, "bower.json"),
25     MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "bower.json")), filename, scope, srcDir)
26 );
28 console.log("Done");