docgen-tool 3.2.6 → 3.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docgen/docgen.js +21 -13
- package/package.json +1 -1
package/dist/docgen/docgen.js
CHANGED
|
@@ -52,7 +52,7 @@ function DocGen(process) {
|
|
|
52
52
|
*/
|
|
53
53
|
this.scaffold = function () {
|
|
54
54
|
console.log(chalk.green('Creating scaffold template directory'));
|
|
55
|
-
copyDirSync(__dirname + '/example', options.output);
|
|
55
|
+
copyDirSync(__dirname + '../include/example', options.output);
|
|
56
56
|
};
|
|
57
57
|
this.run = function () {
|
|
58
58
|
console.log(chalk.green.bold('DocGen version ' + package_json_1.version));
|
|
@@ -81,11 +81,12 @@ function DocGen(process) {
|
|
|
81
81
|
/*
|
|
82
82
|
write any file (async)
|
|
83
83
|
*/
|
|
84
|
-
var writeFile = function (
|
|
84
|
+
var writeFile = function (filePath, data) {
|
|
85
|
+
var normalized = path.normalize(filePath);
|
|
85
86
|
return new rsvp.Promise(function (resolve, reject) {
|
|
86
|
-
fs.writeFile(
|
|
87
|
+
fs.writeFile(normalized, data, function (error) {
|
|
87
88
|
if (error) {
|
|
88
|
-
console.log(chalk.red('Error writing file: ' +
|
|
89
|
+
console.log(chalk.red('Error writing file: ' + normalized));
|
|
89
90
|
reject(error);
|
|
90
91
|
}
|
|
91
92
|
else {
|
|
@@ -98,11 +99,16 @@ function DocGen(process) {
|
|
|
98
99
|
copy any directory (sync)
|
|
99
100
|
*/
|
|
100
101
|
var copyDirSync = function (source, destination) {
|
|
102
|
+
var normalizedSource = path.normalize(source);
|
|
103
|
+
var normalizedDestination = path.normalize(destination);
|
|
101
104
|
try {
|
|
102
|
-
fs.copySync(
|
|
105
|
+
fs.copySync(normalizedSource, normalizedDestination);
|
|
103
106
|
}
|
|
104
107
|
catch (error) {
|
|
105
|
-
console.log(chalk.red('Error copying directory: ' +
|
|
108
|
+
console.log(chalk.red('Error copying directory: ' +
|
|
109
|
+
normalizedSource +
|
|
110
|
+
' to ' +
|
|
111
|
+
normalizedDestination));
|
|
106
112
|
if (options.verbose === true) {
|
|
107
113
|
console.log(chalk.red(error));
|
|
108
114
|
mainProcess.exit(1);
|
|
@@ -112,13 +118,14 @@ function DocGen(process) {
|
|
|
112
118
|
/*
|
|
113
119
|
remake a directory (sync) ... remove and then mkdir in one operation
|
|
114
120
|
*/
|
|
115
|
-
var remakeDirSync = function (
|
|
121
|
+
var remakeDirSync = function (directoryPath) {
|
|
122
|
+
var normalized = path.normalize(directoryPath);
|
|
116
123
|
try {
|
|
117
|
-
fs.removeSync(
|
|
118
|
-
fs.mkdirpSync(
|
|
124
|
+
fs.removeSync(normalized);
|
|
125
|
+
fs.mkdirpSync(normalized);
|
|
119
126
|
}
|
|
120
127
|
catch (error) {
|
|
121
|
-
console.log(chalk.red('Error recreating directory: ' +
|
|
128
|
+
console.log(chalk.red('Error recreating directory: ' + normalized));
|
|
122
129
|
if (options.verbose === true) {
|
|
123
130
|
console.log(chalk.red(error));
|
|
124
131
|
mainProcess.exit(1);
|
|
@@ -128,12 +135,13 @@ function DocGen(process) {
|
|
|
128
135
|
/*
|
|
129
136
|
remove any directory (sync)
|
|
130
137
|
*/
|
|
131
|
-
var removeDirSync = function (
|
|
138
|
+
var removeDirSync = function (directoryPath) {
|
|
139
|
+
var normalized = path.normalize(directoryPath);
|
|
132
140
|
try {
|
|
133
|
-
fs.removeSync(
|
|
141
|
+
fs.removeSync(normalized);
|
|
134
142
|
}
|
|
135
143
|
catch (error) {
|
|
136
|
-
console.log(chalk.red('Error removing directory: ' +
|
|
144
|
+
console.log(chalk.red('Error removing directory: ' + normalized));
|
|
137
145
|
if (options.verbose === true) {
|
|
138
146
|
console.log(chalk.red(error));
|
|
139
147
|
mainProcess.exit(1);
|