Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Commit

Permalink
added java compilation and testing, made run, download and start comm…
Browse files Browse the repository at this point in the history
…ands simpler to use
  • Loading branch information
alesanchezr committed Nov 11, 2019
1 parent a901027 commit 638bb4e
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src/commands/create/exercises.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class StartExercisesComand extends Command {
fs.mkdirSync(`./${basePath}exercises/01-hello-world`);
fs.writeFileSync(`./${basePath}exercises/01-hello-world/README.md`, "# Hello World \n \n Type here your exercise instructions");
}

Console.success(`😋 Exercises boilerplate created successfully`);
}
else Console.error(`The directory must be empty in order to start creating the exercises: ${files.join(',')}`);
}
Expand Down
3 changes: 2 additions & 1 deletion src/commands/download/exercises.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ class SingleCommand extends Command {
type: 'select',
name: 'technology',
message: 'Pick a technology:',
choices: [...new Set(catalog.map(c => ({ title: c.language, value: c.language })))],
choices: [...new Set(catalog.map(c => c.language))].map(c => ({ title: c, value: c })),
}]);
flags.technology = langChoice.technology;
}
if(!flags.technology) return;

let exerciseChoice = await prompts([{
type: 'select',
Expand Down
28 changes: 28 additions & 0 deletions src/commands/download/exercises.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
"url": "https://github.com/4GeeksAcademy/dom-exercises.git",
"folder": "dom-exercises"
},
{
"slug": "javascript-functions-exercises",
"language": "javascript",
"title": "Using functions in Javascript",
"url": "https://github.com/4GeeksAcademy/javascript-functions-exercises.git",
"folder": "javascript-functions-exercises"
},
{
"slug": "html",
"language": "html",
Expand All @@ -26,5 +33,26 @@
"title": "Learn the basics of CSS",
"url": "https://github.com/4GeeksAcademy/css-exercises.git",
"folder": "css-exercises"
},
{
"slug": "bootstrap-exercises",
"language": "css",
"title": "Learn Bootstrap",
"url": "https://github.com/4GeeksAcademy/bootstrap-exercises.git",
"folder": "bootstrap-exercises"
},
{
"slug": "python-beginner-exercises",
"language": "python3",
"title": "Learn and Practice the basics of Python",
"url": "https://github.com/4GeeksAcademy/python-beginner-exercises.git",
"folder": "python-beginner-exercises"
},
{
"slug": "python-lists-exercises",
"language": "python3",
"title": "Looping lists and touples in Python",
"url": "https://github.com/4GeeksAcademy/python-lists-exercises.git",
"folder": "python-lists-exercises"
}
]
4 changes: 2 additions & 2 deletions src/utils/bcTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ module.exports = function({ socket, files, config }){
const { stdout, stderr, code } = shell.exec(command);

if(code != 0){
socket.log('testing-error',[ stdout ]);
socket.log('testing-error',[ stdout || stderr ]);
Console.error("There was an error while testing");
}
else{
socket.log('testing-success',[ stdout ]);
socket.log('testing-success',[ stdout || stderr ]);
Console.success("Everything is amazing!");
}
});
Expand Down
1 change: 1 addition & 0 deletions src/utils/config/compiler/css.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js');
1 change: 1 addition & 0 deletions src/utils/config/compiler/react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js');
1 change: 1 addition & 0 deletions src/utils/config/compiler/vanillajs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./webpack.js');
11 changes: 0 additions & 11 deletions test/commands/code.test.js

This file was deleted.

11 changes: 11 additions & 0 deletions test/commands/create.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const {expect, test} = require('@oclif/test')

describe('create new exercises', () => {
test
.stdout()
.command(['create:exercises'])
.it('runs: $ bc create:exercises', ctx => {
expect(ctx.stdout).to.contain('Pick a language')
})
// TODO: write more advanced tests for the code command.
})

0 comments on commit 638bb4e

Please sign in to comment.