Skip to content

Commit

Permalink
add package
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Nov 22, 2024
1 parent 59a9476 commit 13926ef
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_metadata/
_metadata/
node_modules/
8 changes: 6 additions & 2 deletions pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function copyDir(src, dest) {
const entries = await fsp.readdir(src, { withFileTypes: true });
await fsp.mkdir(dest);
for (let entry of entries) {
if(entry.name === '.git' || entry.name === '.github' || entry.name === '_metadata') continue;
if(entry.name === '.git' || entry.name === '.github' || entry.name === '_metadata' || entry.name === 'node_modules') continue;
const srcPath = path.join(src, entry.name);
const destPath = path.join(dest, entry.name);
if (entry.isDirectory()) {
Expand Down Expand Up @@ -68,8 +68,12 @@ copyDir('./', '../CobaltExtFirefox').then(async () => {
fs.writeFileSync('../CobaltExtFirefox/manifest.json', JSON.stringify(manifest, null, 2));
fs.writeFileSync('../CobaltExtFirefox/options.html', options_html);
fs.unlinkSync('../CobaltExtFirefox/pack.js');
fs.unlinkSync('../CobaltExtFirefox/content_script.js');
fs.unlinkSync('../CobaltExtTempChrome/pack.js');
fs.unlinkSync('../CobaltExtFirefox/content_script.js');
fs.unlinkSync('../CobaltExtTempChrome/package-lock.json');
fs.unlinkSync('../CobaltExtFirefox/package-lock.json');
fs.unlinkSync('../CobaltExtTempChrome/package.json');
fs.unlinkSync('../CobaltExtFirefox/package.json');

console.log("Patched!");
if (fs.existsSync('../CobaltExtFirefox.zip')) {
Expand Down
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "cobalt-extension",
"version": "1.0.0",
"description": "allows easy downloads of media via cobalt.",
"main": "pack.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dimdenGD/cobalt-extension.git"
},
"keywords": [
"cobalt",
"downloader",
"extension"
],
"author": "dimden.dev",
"license": "MIT",
"bugs": {
"url": "https://github.com/dimdenGD/cobalt-extension/issues"
},
"homepage": "https://github.com/dimdenGD/cobalt-extension#readme",
"dependencies": {
"adm-zip": "^0.5.16"
}
}

0 comments on commit 13926ef

Please sign in to comment.