codeplay-common 1.0.16 → 1.0.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Common build scripts and files",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,16 +24,32 @@ if (!fs.existsSync(packageJsonPath)) {
24
24
  process.exit(1);
25
25
  }
26
26
 
27
+
28
+ function copyFolderSync(source, destination) {
29
+ try {
30
+ fs.cpSync(source, destination, { recursive: true });
31
+ console.log(`✅ Copied folder: ${source} -> ${destination}`);
32
+ } catch (error) {
33
+ console.warn(`⚠️ Failed to copy folder: ${source} - ${error.message}`);
34
+ }
35
+ }
36
+
37
+
27
38
  // Copy all files from `common-build-files/files/` to the project root
28
39
  fs.readdirSync(commonBuildPath).forEach(file => {
29
40
  const sourcePath = path.join(commonBuildPath, file);
30
41
  const destPath = path.join(projectRoot, file);
31
42
 
32
- try {
33
- fs.copyFileSync(sourcePath, destPath);
34
- console.log(`✅ Copied: ${file}`);
35
- } catch (error) {
36
- console.warn(`⚠️ Failed to copy: ${file} - ${error.message}`);
43
+ if (fs.statSync(sourcePath).isDirectory()) {
44
+ copyFolderSync(sourcePath, destPath);
45
+ } else {
46
+ try {
47
+ fs.copyFileSync(sourcePath, destPath);
48
+ console.log(`✅ Copied file: ${file}`);
49
+ }
50
+ catch (error) {
51
+ console.warn(`⚠️ Failed to copy file: ${file} - ${error.message}`);
52
+ }
37
53
  }
38
54
  });
39
55