Shanedell commented on code in PR #232:
URL: https://github.com/apache/daffodil-vscode/pull/232#discussion_r923982304


##########
build/scripts/process_build.ts:
##########
@@ -18,39 +18,98 @@
 // @ts-nocheck <-- This is needed as this file is basically a JavaScript script
 //                 but with some TypeScript niceness baked in
 const fs = require('fs')
+const path = require('path')
+const glob = require('glob')
 const execSync = require('child_process').execSync
+const pkg_dir = 'dist/package'
+var fileCount = 0
 
-function prebuild() {
-  fs.renameSync('LICENSE', 'tmp.LICENSE')
-  fs.renameSync('NOTICE', 'tmp.NOTICE')
-  fs.copyFileSync('build/bin.NOTICE', 'NOTICE')
-  fs.copyFileSync('build/bin.LICENSE', 'LICENSE')
+function copyGlob(pattern, skipDirectory = false) {
+  glob(pattern, (error, files) => {
+    for (var i = 0; i < files.length; i++) {
+      let file = !skipDirectory
+        ? files[i]
+        : files[i].split('/')[files[i].split('/').length - 1]
+
+      let directory = path.join(pkg_dir, getDir(file))
+
+      if (!fs.existsSync(directory)) {
+        fs.mkdirSync(directory, { recursive: true })
+      }
+
+      fileCopy(file, `${pkg_dir}/${file}`)
+      fileCount++
+    }
+  })
+}
+
+function getDir(file) {

Review Comment:
   yeah I will delete that out



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to