Search code examples
javascriptgithubcommitcdn

jsdelivr doesn't update github commits


I have a js file stored here in GitHub.

    // Define the function before setup() i.e. at the top if defining in same js file
    // Call the function under draw()
    function pointCoord() {
      stroke(255,0,0);
      line(mouseX,0, mouseX, height);
      line(0,mouseY, width, mouseY);
      if (mouseIsPressed){console.log(`x = ${mouseX}, y = ${mouseY}`);}
      }

This is its jsdelivr link: https://cdn.jsdelivr.net/gh/JaPatGitHub/EduSimulations@main/Tools/x-y-coordinate%20pointer.js

// Define the function before setup() i.e. at the top if defining in same js file
// Call the function under draw()
function pointCoord() {
  stroke(255,0,0);
  line(mouseX,0, mouseX, height);
  line(0,mouseY, width, mouseY);
  if (mouseIsPressed){print("x = "+ mouseX+ ", y = "+mouseY);}
  }

(If you are curious this doesn't look like Vanilla JS code..this file is meant to be used under the p5.js library)

As you would see, the last line on both pages is different. Actually, the jsdelivr page doesn't show the content updated with the previous 2 commits on GitHub - and it's over 10 hours since I have committed them.

Now how do I update the code in jsdelivr CDN?


Solution

  • You can use the following link to retrieve the latest version of your code from jsDelivr: https://cdn.jsdelivr.net/gh/JaPatGitHub/EduSimulations@latest/Tools/x-y-coordinate%20pointer.js

    By using @latest in the link, you're instructing jsDelivr to serve the most recent version available in the repository, regardless of the branch name.