Skip to content

Commit 84b120e

Browse files
authored
Merge pull request #1474 from dhoizner/fix_examples_fetch
update examples.js to strip the proper ref name.
2 parents 305020e + 0346784 commit 84b120e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: server/scripts/examples.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function getCategories() {
7373
function getSketchesInCategories(categories) {
7474
return Q.all(categories.map((category) => {
7575
const options = {
76-
url: `${category.url.replace('?ref=master', '')}?client_id=${clientId}&client_secret=${clientSecret}`,
76+
url: `${category.url.replace('?ref=main', '')}?client_id=${clientId}&client_secret=${clientSecret}`,
7777
method: 'GET',
7878
headers,
7979
json: true
@@ -107,7 +107,7 @@ function getSketchesInCategories(categories) {
107107
function getSketchContent(projectsInAllCategories) {
108108
return Q.all(projectsInAllCategories.map(projectsInOneCategory => Q.all(projectsInOneCategory.map((project) => {
109109
const options = {
110-
url: `${project.sketchUrl.replace('?ref=master', '')}?client_id=${clientId}&client_secret=${clientSecret}`,
110+
url: `${project.sketchUrl.replace('?ref=main', '')}?client_id=${clientId}&client_secret=${clientSecret}`,
111111
method: 'GET',
112112
headers
113113
};
@@ -264,7 +264,7 @@ function createProjectsInP5user(projectsInAllCategories) {
264264
const fileID = objectID().toHexString();
265265
newProject.files.push({
266266
name: assetName,
267-
url: `https://cdn.jsdelivr.net/gh/processing/p5.js-website@master/src/data/examples/assets/${assetName}`,
267+
url: `https://cdn.jsdelivr.net/gh/processing/p5.js-website@main/src/data/examples/assets/${assetName}`,
268268
id: fileID,
269269
_id: fileID,
270270
children: [],

0 commit comments

Comments
 (0)