| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7f448f5 commit 71b3ff2
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,6 @@ | |||
| 6 | 6 | /lib/nodegit.js | |
| 7 | 7 | /node_modules/ | |
| 8 | 8 | /src/ | |
| 9 | - /temp/ | ||
| 10 | 9 | /test/coverage/ | |
| 11 | 10 | /test/home/ | |
| 12 | 11 | /test/repos/ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -231,8 +231,7 @@ module.exports = function generateJson() { | |||
| 231 | 231 | } | |
| 232 | 232 | ||
| 233 | 233 | ||
| 234 | - utils.writeFile("output/idefs.json", output); | ||
| 235 | - | ||
| 234 | + utils.writeFile(path.join(__dirname, "..", "output", "idefs.json"), output); | ||
| 236 | 235 | }; | |
| 237 | 236 | ||
| 238 | 237 | if (require.main === module) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,7 +58,7 @@ module.exports = function generateMissingTests() { | |||
| 58 | 58 | ||
| 59 | 59 | Promise.all(promises).then( | |
| 60 | 60 | function() { | |
| 61 | - utils.writeFile("output/missing-tests.json", output); | ||
| 61 | + utils.writeFile(path.join(__dirname, "..", "/output/missing-tests.json"), output); | ||
| 62 | 62 | }, | |
| 63 | 63 | function(fail) { | |
| 64 | 64 | console.error(fail); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | const path = require("path"); | |
| 2 | 2 | const promisify = require("promisify-node"); | |
| 3 | 3 | const fse = promisify(require("fs-extra")); | |
| 4 | + const os = require('os'); | ||
| 4 | 5 | const exec = require('../../utils/execPromise'); | |
| 5 | 6 | const utils = require("./utils"); | |
| 6 | 7 | ||
@@ -99,7 +100,7 @@ module.exports = function generateNativeCode() { | |||
| 99 | 100 | return !idef.ignore; | |
| 100 | 101 | }); | |
| 101 | 102 | ||
| 102 | - const tempDirPath = path.resolve(__dirname, "../../temp"); | ||
| 103 | + const tempDirPath = path.join(os.tmpdir(), 'nodegit_build'); | ||
| 103 | 104 | const tempSrcDirPath = path.join(tempDirPath, "src"); | |
| 104 | 105 | const tempIncludeDirPath = path.join(tempDirPath, "include"); | |
| 105 | 106 | ||
@@ -113,18 +114,19 @@ module.exports = function generateNativeCode() { | |||
| 113 | 114 | }).then(function() { | |
| 114 | 115 | // Write out single purpose templates. | |
| 115 | 116 | utils.writeFile("../binding.gyp", beautify(templates.binding.render(enabled)), "binding.gyp"); | |
| 116 | - utils.writeFile("../temp/src/nodegit.cc", templates.nodegitCC.render(enabled), "nodegit.cc"); | ||
| 117 | + utils.writeFile(path.join(tempSrcDirPath, "nodegit.cc"), templates.nodegitCC.render(enabled), "nodegit.cc"); | ||
| 117 | 118 | utils.writeFile("../lib/nodegit.js", beautify(templates.nodegitJS.render(enabled)), "nodegit.js"); | |
| 118 | 119 | // Write out all the classes. | |
| 119 | 120 | enabled.forEach(function(idef) { | |
| 120 | 121 | if (idef.type && idef.type != "enum") { | |
| 121 | 122 | utils.writeFile( | |
| 122 | - "../temp/src/" + idef.filename + ".cc", | ||
| 123 | + path.format({dir: tempSrcDirPath, name: idef.filename, ext: ".cc"}), | ||
| 123 | 124 | templates[idef.type + "_content"].render(idef), | |
| 124 | 125 | idef.type + "_content.cc" | |
| 125 | 126 | ); | |
| 127 | + | ||
| 126 | 128 | utils.writeFile( | |
| 127 | - "../temp/include/" + idef.filename + ".h", | ||
| 129 | + path.format({dir: tempIncludeDirPath, name: idef.filename, ext: ".h"}), | ||
| 128 | 130 | templates[idef.type + "_header"].render(idef), | |
| 129 | 131 | idef.type + "_header.h" | |
| 130 | 132 | ); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,9 +29,8 @@ var util = { | |||
| 29 | 29 | } | |
| 30 | 30 | }, | |
| 31 | 31 | ||
| 32 | - writeFile: function(file, content, header) { | ||
| 32 | + writeFile: function(filePath, content, header) { | ||
| 33 | 33 | try { | |
| 34 | - var file = local(file); | ||
| 35 | 34 | if (typeof content == "object") { | |
| 36 | 35 | content = JSON.stringify(content, null, 2) | |
| 37 | 36 | } | |
@@ -45,8 +44,8 @@ var util = { | |||
| 45 | 44 | content; | |
| 46 | 45 | } | |
| 47 | 46 | ||
| 48 | - fse.ensureFileSync(file); | ||
| 49 | - fse.writeFileSync(file, content); | ||
| 47 | + fse.ensureFileSync(filePath); | ||
| 48 | + fse.writeFileSync(filePath, content); | ||
| 50 | 49 | return true; | |
| 51 | 50 | } | |
| 52 | 51 | catch (exception) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments