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.
@@ -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 (path, data) {
84
+ var writeFile = function (filePath, data) {
85
+ var normalized = path.normalize(filePath);
85
86
  return new rsvp.Promise(function (resolve, reject) {
86
- fs.writeFile(path, data, function (error) {
87
+ fs.writeFile(normalized, data, function (error) {
87
88
  if (error) {
88
- console.log(chalk.red('Error writing file: ' + path));
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(source, destination);
105
+ fs.copySync(normalizedSource, normalizedDestination);
103
106
  }
104
107
  catch (error) {
105
- console.log(chalk.red('Error copying directory: ' + source + ' to ' + destination));
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 (path) {
121
+ var remakeDirSync = function (directoryPath) {
122
+ var normalized = path.normalize(directoryPath);
116
123
  try {
117
- fs.removeSync(path);
118
- fs.mkdirpSync(path);
124
+ fs.removeSync(normalized);
125
+ fs.mkdirpSync(normalized);
119
126
  }
120
127
  catch (error) {
121
- console.log(chalk.red('Error recreating directory: ' + path));
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 (path) {
138
+ var removeDirSync = function (directoryPath) {
139
+ var normalized = path.normalize(directoryPath);
132
140
  try {
133
- fs.removeSync(path);
141
+ fs.removeSync(normalized);
134
142
  }
135
143
  catch (error) {
136
- console.log(chalk.red('Error removing directory: ' + path));
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docgen-tool",
3
- "version": "3.2.6",
3
+ "version": "3.2.7",
4
4
  "description": "A tool for creating HTML and PDF documentation",
5
5
  "main": "dist/docgen.js",
6
6
  "bin": {