Browse Source

Update Makefile

Lutz Roeder 3 years ago
parent
commit
0c0687b874
2 changed files with 5 additions and 2 deletions
  1. 1 0
      Makefile
  2. 4 2
      publish/server.js

+ 1 - 0
Makefile

@@ -40,6 +40,7 @@ update: install
 
 build_python: install
 	python -m pip install --user build wheel --quiet
+	rm -rf ./source/__pycache__
 	rm -rf ./dist/pypi
 	mkdir -p ./dist/pypi/netron
 	cp -R ./source/* ./dist/pypi/netron

+ 4 - 2
publish/server.js

@@ -12,8 +12,10 @@ if (fs.existsSync(target)) {
 
 fs.mkdirSync(target, { recursive: true });
 
-for (const file of fs.readdirSync(source)) {
-    fs.copyFileSync(path.join(source, file), path.join(target, file));
+for (const entry of fs.readdirSync(source, { withFileTypes: true })) {
+    if (entry.isFile()) {
+        fs.copyFileSync(path.join(source, entry.name), path.join(target, entry.name));
+    }
 }
 
 const options = { stdio: 'inherit' };