Skip to content

Commit

Permalink
Feat: Update Readme + cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Amzani committed Jun 4, 2023
1 parent f4f7b19 commit 289df81
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ yarn-error.log*
# custom
data.json
public/rss.xml
public/logo.svg
public/logo.svg
shapeup.config.js
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ First, go to your Github profile and create a new Project. Then go to Project se

You can now go to your project and start adding bets, pitches, scopes, etc.

Once you got your project setup, go to the `shapeup.config.js` file and replace the `owner` (your Github username) and `projectNumber` (the ID of your project) values with your own ones.

Right after that, create a file called `.env.local` and add the following line:
Once you got your project setup

```
GITHUB_TOKEN=[your-github-token]
npm run cli init
```
This will create `shapeup.config.js` file and generate `.env.local` that will contains your `GITHUB_TOKEN`

> You can create a new personal token [here](https://github.com/settings/tokens). Make sure it has, at least, the following scopes: `public_repo`, `read:project`, `read:user`.
Expand Down
19 changes: 10 additions & 9 deletions cli/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const program = new Command();
program.version('1.0.0');

program
.command('configure')
.command('init')
.description('Configure your ShapeUp dashboard')
.action(async () => {
const questions = [
{ type: 'input', name: 'owner', message: 'Enter your Github username:' },
{ type: 'input', name: 'projectNumber', message: 'Enter project number:' },
{ type: 'input', name: 'projectNumber', message: 'Enter a project number:' },
{ type: 'input', name: 'fullname', message: 'Enter Your full name:' },
{ type: 'input', name: 'email', message: 'Enter email:' },
{ type: 'input', name: 'project', message: 'Enter your project Name:' },
Expand All @@ -25,15 +25,15 @@ program
const answers = await inquirer.prompt(questions);

const config = {
[owner]: answers.owner || '',
[projectNumber]: parseInt(answers.projectNumber) || '',
[fullname]: answers.fullname || '',
[email]: answers.email || '',
[project]: answers.project || '',
[website]: answers.website || '',
owner: answers.owner || '',
projectNumber: parseInt(answers.projectNumber) || '',
fullname: answers.fullname || '',
email: answers.email || '',
project: answers.project || '',
website: answers.website || '',
};

config[tagline] = `Visualize the progress of my work at <a href="${config.website}" target="_blank">${config.project}</a>. Want to propose that I work on something? <a href="https://github.com/${config.owner}/shapeup/issues/new?assignees=&labels=Pitch&template=pitch.yaml&title=" target="_blank">Time to pitch!</a>`;
config.tagline = `Visualize the progress of my work at <a href="${config.website}" target="_blank">${config.project}</a>. Want to propose that I work on something? <a href="https://github.com/${config.owner}/shapeup/issues/new?assignees=&labels=Pitch&template=pitch.yaml&title=" target="_blank">Time to pitch!</a>`;

const configFilePath = 'shapeup.config.js';
fs.writeFileSync(configFilePath, `module.exports = ${JSON.stringify(config, null, 2)};\n`);
Expand All @@ -44,4 +44,5 @@ program
console.log('Configuration generated successfully!');
});


program.parse(process.argv);
7 changes: 0 additions & 7 deletions shapeup.config,save.js

This file was deleted.

File renamed without changes.

0 comments on commit 289df81

Please sign in to comment.