generator-razor 14.0.13 → 14.0.15

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/app/index.js CHANGED
@@ -333,9 +333,13 @@ export default class extends Generator {
333
333
  await this._ensureTypo3Source(sourcePath)
334
334
  await this._createSymlinks(sourcePath)
335
335
 
336
- await this._copyWithInheritedGroup(
336
+ await fs.copy(
337
337
  this.templatePath(templateVersion),
338
- this.destinationPath()
338
+ this.destinationPath(),
339
+ {
340
+ overwrite: true,
341
+ errorOnExist: false
342
+ }
339
343
  )
340
344
 
341
345
  await this._writeSystemSettings()
@@ -394,6 +398,8 @@ export default class extends Generator {
394
398
  }
395
399
  }
396
400
 
401
+ await this._fixProjectGroup()
402
+
397
403
  const orange = chalk.hex('#ff8700').bold
398
404
  const petrol = chalk.hex('#006792')
399
405
 
@@ -411,61 +417,40 @@ export default class extends Generator {
411
417
  ))
412
418
  }
413
419
 
414
- async _copyWithInheritedGroup (source, destination) {
415
- const sourceStats = await fs.lstat(source)
416
-
417
- if (sourceStats.isDirectory()) {
418
- await fs.ensureDir(destination)
420
+ async _fixProjectGroup () {
421
+ const destination = this.destinationPath()
422
+ const destinationStats = await fs.stat(destination)
423
+ const targetGid = destinationStats.gid
419
424
 
420
- // Files created afterwards inherit this directory's group.
421
- await fs.chmod(destination, 0o2775)
425
+ const processPath = async filePath => {
426
+ const stats = await fs.lstat(filePath)
422
427
 
423
- const entries = await fs.readdir(
424
- source,
425
- {
426
- withFileTypes: true
427
- }
428
- )
429
-
430
- for (const entry of entries) {
431
- await this._copyWithInheritedGroup(
432
- path.join(source, entry.name),
433
- path.join(destination, entry.name)
434
- )
428
+ if (stats.isSymbolicLink()) {
429
+ await fs.lchown(filePath, stats.uid, targetGid)
430
+ return
435
431
  }
436
432
 
437
- return
438
- }
439
-
440
- await fs.ensureDir(path.dirname(destination))
433
+ await fs.chown(filePath, stats.uid, targetGid)
441
434
 
442
- if (sourceStats.isSymbolicLink()) {
443
- const linkTarget = await fs.readlink(source)
444
-
445
- await fs.remove(destination)
435
+ if (!stats.isDirectory()) {
436
+ return
437
+ }
446
438
 
447
- // Preserve the relative link exactly as it exists in the template.
448
- await fs.symlink(
449
- linkTarget,
450
- destination
439
+ await fs.chmod(
440
+ filePath,
441
+ stats.mode | 0o2070
451
442
  )
452
443
 
453
- return
454
- }
455
-
456
- // copyFile() would otherwise overwrite an existing inode and retain
457
- // its previous group. Removing it first forces group inheritance.
458
- await fs.remove(destination)
444
+ const entries = await fs.readdir(filePath)
459
445
 
460
- await fs.copyFile(
461
- source,
462
- destination
463
- )
446
+ for (const entry of entries) {
447
+ await processPath(
448
+ path.join(filePath, entry)
449
+ )
450
+ }
451
+ }
464
452
 
465
- await fs.chmod(
466
- destination,
467
- sourceStats.mode & 0o777
468
- )
453
+ await processPath(destination)
469
454
  }
470
455
 
471
456
  async _getTypo3Releases () {
@@ -110,6 +110,8 @@ return [
110
110
  'unifiedPageTranslationHandling' => true,
111
111
  'yamlImportsFollowDeclarationOrder' => true,
112
112
  ],
113
+ 'fileCreateMask' => 0664,
114
+ 'folderCreateMask' => 2775,
113
115
  'sitename' => '###PROJECTNAME###',
114
116
  'systemMaintainers' => [
115
117
  1,
@@ -110,6 +110,8 @@ return [
110
110
  'unifiedPageTranslationHandling' => true,
111
111
  'yamlImportsFollowDeclarationOrder' => true,
112
112
  ],
113
+ 'fileCreateMask' => 0664,
114
+ 'folderCreateMask' => 2775,
113
115
  'sitename' => '###PROJECTNAME###',
114
116
  'systemMaintainers' => [
115
117
  1,
@@ -109,6 +109,8 @@ return [
109
109
  'unifiedPageTranslationHandling' => true,
110
110
  'yamlImportsFollowDeclarationOrder' => true,
111
111
  ],
112
+ 'fileCreateMask' => 0664,
113
+ 'folderCreateMask' => 2775,
112
114
  'sitename' => '###PROJECTNAME###',
113
115
  'systemMaintainers' => [
114
116
  1,
@@ -109,6 +109,8 @@ return [
109
109
  'unifiedPageTranslationHandling' => true,
110
110
  'yamlImportsFollowDeclarationOrder' => true,
111
111
  ],
112
+ 'fileCreateMask' => 0664,
113
+ 'folderCreateMask' => 2775,
112
114
  'sitename' => '###PROJECTNAME###',
113
115
  'systemMaintainers' => [
114
116
  1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-razor",
3
- "version": "14.0.13",
3
+ "version": "14.0.15",
4
4
  "description": "Yeoman generator for razor TYPO3 distribution",
5
5
  "license": "MIT",
6
6
  "main": "app/index.js",