Skip to content

Commit

Permalink
Merge pull request #984 from th-ch/th-ch/fix-bypass-age-import
Browse files Browse the repository at this point in the history
Fix bypass-age-restriction lib import
  • Loading branch information
th-ch authored Jan 17, 2023
2 parents a51ed89 + b518866 commit 0f09f8a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@
"build:win": "yarn run clean && electron-builder --win",
"lint": "xo",
"changelog": "auto-changelog",
"plugins": "yarn run plugin:adblocker",
"plugins": "yarn run plugin:adblocker && yarn run plugin:bypass-age-restrictions",
"plugin:adblocker": "rimraf plugins/adblocker/ad-blocker-engine.bin && node plugins/adblocker/blocker.js",
"plugin:bypass-age-restrictions": "yarn run generate:package Simple-YouTube-Age-Restriction-Bypass",
"release:linux": "yarn run clean && electron-builder --linux -p always -c.snap.publish=github",
"release:mac": "yarn run clean && electron-builder --mac -p always",
"release:win": "yarn run clean && electron-builder --win -p always"
Expand Down
2 changes: 1 addition & 1 deletion plugins/bypass-age-restrictions/front.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = () => {
// See https://github.com/zerodytrash/Simple-YouTube-Age-Restriction-Bypass#userscript
require("simple-youtube-age-restriction-bypass/Simple-YouTube-Age-Restriction-Bypass.user.js");
require("Simple-YouTube-Age-Restriction-Bypass/Simple-YouTube-Age-Restriction-Bypass.user.js");
};
10 changes: 9 additions & 1 deletion utils/generate-package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ const { promisify } = require("util");
*/

const generatePackageJson = async packageName => {
var filepath = join("node_modules", packageName, "package.json");
const packageFolder = join("node_modules", packageName)
if (!existsSync(packageFolder )) {
console.log(
`${packageName} module not found, exiting…`
);
return
}

const filepath = join(packageFolder, "package.json");
if (!existsSync(filepath)) {
console.log(
`No package.json found for ${packageName} module, generating one…`
Expand Down

0 comments on commit 0f09f8a

Please sign in to comment.