Merge pull request #1474 from dhoizner/fix_examples_fetch
update examples.js to strip the proper ref name.
This commit is contained in:
commit
84b120ef82
1 changed files with 3 additions and 3 deletions
|
@ -73,7 +73,7 @@ function getCategories() {
|
||||||
function getSketchesInCategories(categories) {
|
function getSketchesInCategories(categories) {
|
||||||
return Q.all(categories.map((category) => {
|
return Q.all(categories.map((category) => {
|
||||||
const options = {
|
const options = {
|
||||||
url: `${category.url.replace('?ref=master', '')}?client_id=${clientId}&client_secret=${clientSecret}`,
|
url: `${category.url.replace('?ref=main', '')}?client_id=${clientId}&client_secret=${clientSecret}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers,
|
headers,
|
||||||
json: true
|
json: true
|
||||||
|
@ -107,7 +107,7 @@ function getSketchesInCategories(categories) {
|
||||||
function getSketchContent(projectsInAllCategories) {
|
function getSketchContent(projectsInAllCategories) {
|
||||||
return Q.all(projectsInAllCategories.map(projectsInOneCategory => Q.all(projectsInOneCategory.map((project) => {
|
return Q.all(projectsInAllCategories.map(projectsInOneCategory => Q.all(projectsInOneCategory.map((project) => {
|
||||||
const options = {
|
const options = {
|
||||||
url: `${project.sketchUrl.replace('?ref=master', '')}?client_id=${clientId}&client_secret=${clientSecret}`,
|
url: `${project.sketchUrl.replace('?ref=main', '')}?client_id=${clientId}&client_secret=${clientSecret}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers
|
headers
|
||||||
};
|
};
|
||||||
|
@ -264,7 +264,7 @@ function createProjectsInP5user(projectsInAllCategories) {
|
||||||
const fileID = objectID().toHexString();
|
const fileID = objectID().toHexString();
|
||||||
newProject.files.push({
|
newProject.files.push({
|
||||||
name: assetName,
|
name: assetName,
|
||||||
url: `https://cdn.jsdelivr.net/gh/processing/p5.js-website@master/src/data/examples/assets/${assetName}`,
|
url: `https://cdn.jsdelivr.net/gh/processing/p5.js-website@main/src/data/examples/assets/${assetName}`,
|
||||||
id: fileID,
|
id: fileID,
|
||||||
_id: fileID,
|
_id: fileID,
|
||||||
children: [],
|
children: [],
|
||||||
|
|
Loading…
Reference in a new issue