@gallop.software/studio 2.1.12 → 2.1.14

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.
@@ -11,7 +11,7 @@
11
11
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
12
12
  }
13
13
  </style>
14
- <script type="module" crossorigin src="/assets/index-Cug_vb5C.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-NaPJ8Bxp.js"></script>
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
@@ -1937,6 +1937,13 @@ async function handleScanStream() {
1937
1937
  `));
1938
1938
  };
1939
1939
  try {
1940
+ let isHiddenOrSystemFile3 = function(filename) {
1941
+ if (filename.startsWith(".")) return true;
1942
+ const windowsFiles = ["thumbs.db", "desktop.ini", "ehthumbs.db", "ehthumbs_vista.db"];
1943
+ if (windowsFiles.includes(filename.toLowerCase())) return true;
1944
+ return false;
1945
+ };
1946
+ var isHiddenOrSystemFile2 = isHiddenOrSystemFile3;
1940
1947
  const meta = await loadMeta();
1941
1948
  const existingCount = Object.keys(meta).filter((k) => !k.startsWith("_")).length;
1942
1949
  const existingKeys = new Set(Object.keys(meta));
@@ -2082,6 +2089,38 @@ async function handleScanStream() {
2082
2089
  }
2083
2090
  }
2084
2091
  await cleanEmptyFolders(getPublicPath());
2092
+ async function cleanImagesFolders(dir) {
2093
+ try {
2094
+ const entries = await fs8.readdir(dir, { withFileTypes: true });
2095
+ let isEmpty = true;
2096
+ for (const entry of entries) {
2097
+ if (entry.isDirectory()) {
2098
+ const subDirEmpty = await cleanImagesFolders(path8.join(dir, entry.name));
2099
+ if (!subDirEmpty) isEmpty = false;
2100
+ } else if (!isHiddenOrSystemFile3(entry.name)) {
2101
+ isEmpty = false;
2102
+ }
2103
+ }
2104
+ if (isEmpty) {
2105
+ for (const entry of entries) {
2106
+ if (!entry.isDirectory() && isHiddenOrSystemFile3(entry.name)) {
2107
+ try {
2108
+ await fs8.unlink(path8.join(dir, entry.name));
2109
+ } catch {
2110
+ }
2111
+ }
2112
+ }
2113
+ await fs8.rmdir(dir);
2114
+ }
2115
+ return isEmpty;
2116
+ } catch {
2117
+ return true;
2118
+ }
2119
+ }
2120
+ try {
2121
+ await cleanImagesFolders(imagesDir);
2122
+ } catch {
2123
+ }
2085
2124
  await saveMeta(meta);
2086
2125
  sendEvent({
2087
2126
  type: "complete",