-
Notifications
You must be signed in to change notification settings - Fork 406
#RI-2450 - add tutorials provider #367
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
Changes from all commits
e655418
465a92e
d81ec5f
654dd7f
f4c7be6
6999dbb
91e76f5
770852c
e57a475
23f0543
bf629ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,10 @@ | |
}, | ||
"scripts": { | ||
"build:defaults:commands": "ts-node ./scripts/default-commands.ts", | ||
"build:defaults:enablement-area": "ts-node ./scripts/default-enablement-area.ts", | ||
"build:defaults:guides": "ts-node ./scripts/default-guides.ts", | ||
"build:defaults:tutorials": "ts-node ./scripts/default-tutorials.ts", | ||
"build:defaults:content": "ts-node ./scripts/default-content.ts", | ||
"build:defaults": "yarn build:defaults:enablement-area && yarn build:defaults:commands yarn build:defaults:content", | ||
"build:defaults": "yarn build:defaults:guides && yarn build:defaults:commands && yarn build:defaults:content && build:defaults:tutorials", | ||
"prebuild": "rimraf dist", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you test it locally? I assume that default tutorials will not work because I don't see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't include the tutorials because there are no files in the repository, so the script will fail with an error There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, do not hurry up build:defaults:tutorialss |
||
"build": "nest build", | ||
"build:prod": "rimraf dist && nest build -p ./tsconfig.build.prod.json && cross-env NODE_ENV=production", | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as path from 'path'; | ||
import { getFile, updateFolderFromArchive, updateFile } from '../src/utils/file-helper'; | ||
import { get } from '../src/utils/config'; | ||
|
||
const PATH_CONFIG = get('dir_path'); | ||
const GUIDES_CONFIG = get('guides'); | ||
|
||
const archiveUrl = new URL(path.join( | ||
GUIDES_CONFIG.updateUrl, | ||
GUIDES_CONFIG.zip, | ||
)).toString(); | ||
|
||
const buildInfoUrl = new URL(path.join( | ||
GUIDES_CONFIG.updateUrl, | ||
GUIDES_CONFIG.buildInfo, | ||
)).toString(); | ||
|
||
async function init() { | ||
try { | ||
// // get archive | ||
const data = await getFile(archiveUrl); | ||
|
||
// extract archive to default folder | ||
await updateFolderFromArchive(PATH_CONFIG.defaultGuides, data); | ||
|
||
// // get build info | ||
const buildInfo = await getFile(buildInfoUrl); | ||
|
||
// save build info to default folder | ||
await updateFile(PATH_CONFIG.defaultGuides, GUIDES_CONFIG.buildInfo, buildInfo); | ||
|
||
process.exit(0); | ||
} catch (e) { | ||
console.error('Something went wrong trying to get default guides archive', e); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
init(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as path from 'path'; | ||
import { getFile, updateFolderFromArchive, updateFile } from '../src/utils/file-helper'; | ||
import { get } from '../src/utils/config'; | ||
|
||
const PATH_CONFIG = get('dir_path'); | ||
const TUTORIALS_CONFIG = get('tutorials'); | ||
|
||
const archiveUrl = new URL(path.join( | ||
TUTORIALS_CONFIG.updateUrl, | ||
TUTORIALS_CONFIG.zip, | ||
)).toString(); | ||
|
||
const buildInfoUrl = new URL(path.join( | ||
TUTORIALS_CONFIG.updateUrl, | ||
TUTORIALS_CONFIG.buildInfo, | ||
)).toString(); | ||
|
||
async function init() { | ||
try { | ||
// get archive | ||
const data = await getFile(archiveUrl); | ||
|
||
// extract archive to default folder | ||
await updateFolderFromArchive(PATH_CONFIG.defaultTutorials, data); | ||
|
||
// get build info | ||
const buildInfo = await getFile(buildInfoUrl); | ||
|
||
// save build info to default folder | ||
await updateFile(PATH_CONFIG.defaultTutorials, TUTORIALS_CONFIG.buildInfo, buildInfo); | ||
|
||
process.exit(0); | ||
} catch (e) { | ||
console.error('Something went wrong trying to get default tutorials archive', e); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
init(); |
Uh oh!
There was an error while loading. Please reload this page.