Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

### Others

- cli: v2.2.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/cli/CHANGELOG.md))
- deck-utils: v3.4.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/utils/deck/CHANGELOG.md))
- kit: v2.1.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/kit/CHANGELOG.md))
- starter kit: v7.1.5 ([CHANGELOG](https://github.com/deckgo/starter-kit/blob/master/CHANGELOG.md))
Expand Down
8 changes: 8 additions & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<a name="2.2.0"></a>

# 2.2.0 (2021-03-11)

### Chore

- we have renamed our `master` branch in `main` therefore kits have to be fetched with a new url

<a name="2.1.1"></a>

# 2.1.1 (2021-01-24)
Expand Down
2 changes: 1 addition & 1 deletion cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-deckdeckgo",
"version": "2.1.1",
"version": "2.2.0",
"description": "Create a new DeckDeckGo presentation or template",
"main": "dist/index.js",
"scripts": {
Expand Down
34 changes: 17 additions & 17 deletions cli/src/presentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {Spinner} from 'cli-spinner';

import {installFont} from './utils/fonts';
import {rimraf} from './utils/utils';
import {downloadStarterMaster} from './utils/download';
import {downloadStarterMain} from './utils/download';
import {unZipBuffer} from './utils/unzip';
import { installDependencies } from "./utils/install";
import {installDependencies} from './utils/install';

interface Answers {
folder: string;
Expand Down Expand Up @@ -74,36 +74,36 @@ const prompt = (): Promise<Answers> => {
const inquirer = require('inquirer');

return inquirer.prompt(questions);
}
};

const info = (answers: Answers) => {
console.log(
'\nRun ' +
cyan('npm run start') +
' in the newly created folder ' +
cyan(answers.folder) +
' to serve your presentation locally at the address ' +
cyan('http://localhost:3000') +
'\n'
cyan('npm run start') +
' in the newly created folder ' +
cyan(answers.folder) +
' to serve your presentation locally at the address ' +
cyan('http://localhost:3000') +
'\n'
);

console.log('Find this presentation in the remote control with the keyword: ' + cyan(answers.title) + '\n');
console.log(
'If you rather like not to use the remote control while developing your deck, run ' +
cyan('npm run start-no-remote') +
' instead of the previous command\n'
cyan('npm run start-no-remote') +
' instead of the previous command\n'
);

console.log('Dive deeper with the "Getting Started" guide at ' + cyan('https://docs.deckdeckgo.com') + '\n');
}
};

const createPresentation = async (answers: Answers) => {
await downloadInstallPresentation(answers);

await installDependencies(answers.folder, '2/3');

await updatePresentation(answers);
}
};

const downloadInstallPresentation = async (answers: Answers) => {
const loading = new Spinner(bold('[1/3] Creating your presentation...'));
Expand All @@ -114,11 +114,11 @@ const downloadInstallPresentation = async (answers: Answers) => {
rimraf(answers.folder);

// 2. Download starter
const buffer = await downloadStarterMaster();
const buffer = await downloadStarterMain();
await unZipBuffer(buffer, answers.folder);

loading.stop(true);
}
};

const updatePresentation = async (answers: Answers) => {
const loading = new Spinner(bold('[3/3] Updating presentation...'));
Expand All @@ -129,7 +129,7 @@ const updatePresentation = async (answers: Answers) => {
replaceAnswers(answers);

loading.stop(true);
}
};

const replaceAnswers = (answers: Answers) => {
const replaceResources = [
Expand Down Expand Up @@ -171,4 +171,4 @@ const replaceAnswers = (answers: Answers) => {
recursive: false,
silent: true
});
}
};
4 changes: 2 additions & 2 deletions cli/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {bold, cyan} from 'colorette';
import {Spinner} from 'cli-spinner';

import {rimraf} from './utils/utils';
import {downloadTemplateMaster} from './utils/download';
import {downloadTemplateMain} from './utils/download';
import {unZipBuffer} from './utils/unzip';
import {installDependencies} from './utils/install';

Expand Down Expand Up @@ -62,7 +62,7 @@ const downloadTemplate = async (answers: Answers) => {
rimraf(answers.name);

// 2. Download starter
const buffer = await downloadTemplateMaster();
const buffer = await downloadTemplateMain();
await unZipBuffer(buffer, answers.name);

loading.stop(true);
Expand Down
8 changes: 4 additions & 4 deletions cli/src/utils/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import {get, RequestOptions} from 'https';
import fs from 'fs';
import path from 'path';

export function downloadStarterMaster() {
return downloadFromURL(`https://github.com/deckgo/starter-kit/archive/master.zip`);
export function downloadStarterMain() {
return downloadFromURL(`https://github.com/deckgo/starter-kit/archive/main.zip`);
}

export function downloadFontsKey() {
return downloadFromURL(`https://api.deckdeckgo.com/googlefonts/`);
}

export function downloadTemplateMaster() {
return downloadFromURL(`https://github.com/deckgo/template-kit/archive/master.zip`);
export function downloadTemplateMain() {
return downloadFromURL(`https://github.com/deckgo/template-kit/archive/main.zip`);
}

export function downloadFontsList(key: string) {
Expand Down