Browse Source

Enhance copy-img script to ensure destination directory exists and use shx for cross-platform compatibility

codecalm 7 months ago
parent
commit
1b0266e612
3 changed files with 37 additions and 2 deletions
  1. 1 1
      core/package.json
  2. 2 1
      package.json
  3. 34 0
      pnpm-lock.yaml

+ 1 - 1
core/package.json

@@ -23,7 +23,7 @@
     "js-minify-standalone": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler.js.map,includeSources,url=tabler.min.js.map\" --output dist/js/tabler.min.js dist/js/tabler.js",
     "js-minify-standalone-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/tabler.esm.js.map,includeSources,url=tabler.esm.min.js.map\" --output dist/js/tabler.esm.min.js dist/js/tabler.esm.js",
     "copy": "pnpm run copy-img",
-    "copy-img": "cp -r img dist/img",
+    "copy-img": "mkdir -p dist/img && shx cp -rf img/* dist/img",
     "watch": "concurrently \"pnpm run watch-css\" \"pnpm run watch-js\"",
     "watch-css": "nodemon --watch scss/ --ext scss --exec \"pnpm run css-compile && pnpm run css-prefix\"",
     "watch-js": "nodemon --watch js/ --ext js --exec \"pnpm run js-compile\"",

+ 2 - 1
package.json

@@ -36,6 +36,7 @@
     "rtlcss": "^4.3.0",
     "sass": "1.71.0",
     "terser": "^5.38.1",
-    "turbo": "^2.4.0"
+    "turbo": "^2.4.0",
+    "shx": "^0.3.4"
   }
 }

+ 34 - 0
pnpm-lock.yaml

@@ -74,6 +74,9 @@ importers:
       sass:
         specifier: 1.71.0
         version: 1.71.0
+      shx:
+        specifier: ^0.3.4
+        version: 0.3.4
       terser:
         specifier: ^5.38.1
         version: 5.38.1
@@ -2304,6 +2307,11 @@ packages:
     resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
     dev: true
 
+  /[email protected]:
+    resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==}
+    engines: {node: '>= 0.10'}
+    dev: true
+
   /[email protected]:
     resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==}
     dev: true
@@ -3241,6 +3249,13 @@ packages:
       picomatch: 2.3.1
     dev: true
 
+  /[email protected]:
+    resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==}
+    engines: {node: '>= 0.10'}
+    dependencies:
+      resolve: 1.22.10
+    dev: true
+
   /[email protected]:
     resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==}
 
@@ -3451,6 +3466,25 @@ packages:
     engines: {node: '>= 0.4'}
     dev: true
 
+  /[email protected]:
+    resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==}
+    engines: {node: '>=4'}
+    hasBin: true
+    dependencies:
+      glob: 7.2.3
+      interpret: 1.4.0
+      rechoir: 0.6.2
+    dev: true
+
+  /[email protected]:
+    resolution: {integrity: sha512-N6A9MLVqjxZYcVn8hLmtneQWIJtp8IKzMP4eMnx+nqkvXoqinUPCbUFLp2UcWTEIUONhlk0ewxr/jaVGlc+J+g==}
+    engines: {node: '>=6'}
+    hasBin: true
+    dependencies:
+      minimist: 1.2.8
+      shelljs: 0.8.5
+    dev: true
+
   /[email protected]:
     resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
     engines: {node: '>=14'}