Skip to content
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

Initial Setup of fs-12 Objective #45

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
3 changes: 2 additions & 1 deletion levels/tower_of_knowledge/level.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"fs-02-pwd",
"fs-03-ls",
"fs-04-cd",
"fs-05-mkdir"
"fs-05-mkdir",
"fs-12-cp"
]
}
25 changes: 25 additions & 0 deletions levels/tower_of_knowledge/objectives/fs-12-cp/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<% const isWindows = context.systemInfo.os === 'win32'; %>

# Copying Our Spoons

<div class="aside">
<h3>Requirements</h3>
<ul>
<li>Step 1.</li>
<li>Step 2.</li>
<li>Step 3.</li>
<li>Once you're done, press <em>HACK</em>.</li>
</ul>
</div>

General content here...

<% if(isWindows) { %>

Windows specific content here...

<% } else { %>

\*nix specific content here...

<% } %>
16 changes: 16 additions & 0 deletions levels/tower_of_knowledge/objectives/fs-12-cp/objective.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"title": "Copying Our Spoons",
"description": "Copy the correct number of spoons to the same drawer directory.",
"validation_fields": [
{
"name": "prompt",
"type": "prompt",
"placeholder": "",
"label": "Once you've copied all the spoons to the correct drawer directory, HACK away!"
}
],
"show_ide": false,
"rewards": {
"xp": 100
}
}
18 changes: 18 additions & 0 deletions levels/tower_of_knowledge/objectives/fs-12-cp/validator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { existsSync } = require("fs");

module.exports = async function (helper) {
const { DEV_FUNDAMENTALS_FILE_SYSTEM_CUTLERY_DRAWER_DIR } = helper.env;

try {
// TODO: Check for spoon in correct draw, check for mv in command history
} catch (err) {
helper.fail(`An error occurred while TwilioQuest was checking for the copied spoons.

${err}`);
return;
}

helper.success(
"TwilioQuest found the copied spoons in the correct drawer directory! Good job!"
);
};
3 changes: 3 additions & 0 deletions levels/tower_of_knowledge/objectives/fs-12-cp/walkthrough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Walkthrough

Content here...