Ver código fonte

ref: update post-build & ext. assets readme

Sven 1 ano atrás
pai
commit
2f36c4fede
2 arquivos alterados com 8 adições e 6 exclusões
  1. 2 2
      assets/external/README.md
  2. 6 4
      src/tools/post-build.ts

+ 2 - 2
assets/external/README.md

@@ -1,5 +1,5 @@
 ## Note about external assets:
-I do not own any of the assets in this folder.  
-They belong to their respective owners and I am only re-hosting them to ensure availability and stability:
+I do not own any of the assets in this folder, I am just re-hosting them here to ensure availability and a predefined size.  
+They belong to their respective owners:
 - The GitHub logo is owned by GitHub Inc.
 - The GreasyFork logo is owned by Jason Barnabe.

+ 6 - 4
src/tools/post-build.ts

@@ -192,10 +192,12 @@ async function getResourceDirectives() {
     const resourcesFile = String(await readFile(join(assetFolderPath, "resources.json")));
     const resources = JSON.parse(resourcesFile) as Record<string, string>;
 
-    for(const [name, path] of Object.entries(resources)) {
-      const url = path.match(/^https?:\/\//) ? path : `https://raw.githubusercontent.com/Sv443/BetterYTM/${branch}/assets/${path}`;
-      directives.push(`// @resource        ${name} ${url}`);
-    }
+    for(const [name, path] of Object.entries(resources))
+      directives.push(`// @resource        ${name} ${
+        path.match(/^https?:\/\//)
+          ? path
+          : `https://raw.githubusercontent.com/Sv443/BetterYTM/${branch}/assets/${path}`
+      }`);
 
     return directives.join("\n");
   }