Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in package_abridge.js #176

Merged
merged 1 commit into from
Jun 29, 2024
Merged

Fix bug in package_abridge.js #176

merged 1 commit into from
Jun 29, 2024

Conversation

Hysterelius
Copy link
Contributor

There was a bug in the expression for the args in the abridge npm (package_abridge.js) script, which was causing the variable to be undefined.

Due to the string expression always containing ' ', it would always evaluate to true, resulting in undefined behavior. I have fixed it by using a ternary operator to correctly evaluate if it is true.

This created errors like this:

> [email protected] abridge /.../abridge
> node -e "if ( require('fs').existsSync('./themes/abridge/package_abridge.js')) {require('fs').copyFileSync('./themes/abridge/package_abridge.js', './package_abridge.js')}" && node package_abridge.js

args:  undefined, process.argv: /usr/bin/node-20,/.../abridge/package_abridge.js
Zola Build to generate files for minification:
node:internal/errors:984
  const err = new Error(message);
              ^

Error: Command failed: zola build undefined
error: unexpected argument 'undefined' found

Usage: zola build [OPTIONS]

For more information, try '--help'.

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:518:28)
    at Pipe.<anonymous> (node:net:337:12) {
  code: 2,
  killed: false,
  signal: null,
  cmd: 'zola build undefined',
  stdout: '',
  stderr: "error: unexpected argument 'undefined' found\n" +
    '\n' +
    'Usage: zola build [OPTIONS]\n' +
    '\n' +
    "For more information, try '--help'.\n"
}

Node.js v20.12.2
 ELIFECYCLE  Command failed with exit code 1.

Copy link

netlify bot commented Jun 29, 2024

Deploy Preview for abridge ready!

Name Link
🔨 Latest commit b5f911c
🔍 Latest deploy log https://app.netlify.com/sites/abridge/deploys/667fbd13c2f9740008a814d6
😎 Deploy Preview https://deploy-preview-176--abridge.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Jieiku
Copy link
Owner

Jieiku commented Jun 29, 2024

DOH! surprised I missed that! Thank you very much!

@Jieiku Jieiku merged commit 38c9504 into Jieiku:master Jun 29, 2024
4 of 5 checks passed
@Hysterelius
Copy link
Contributor Author

I am not sure where to ask this, but I was wondering why you chose to use elasticlunr in abridge?

I was considering adding flexsearch to abridge, but you might have already evaluated that option. I wanted to check before trying to add it.

@Jieiku
Copy link
Owner

Jieiku commented Jul 1, 2024

I opened an issue here #178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants