Skip to content
Open
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
26 changes: 25 additions & 1 deletion task-1/setup.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
# Write your code here
#!/usr/bin/env bash

echo "Creating project..."
git init project
cd project/
mkdir -p {resources,src/{database,profile}}
touch README.md resources/{family-picture.jpg,icon.png,logo.png} settings.conf src/program.java

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Very advanced way to create files 👏

There is just a typo in the family-picture.jpg (which should have a space instead of -)

I assume you were having problems with spaces. But you can use it by escaping (use \ before the space)

git add .
git commit -m "Initial commit"
sleep 3
echo "Setup project..."
echo "Welcome to my project" > README.md
rm -r src/profile
rm resources/family-picture.jpg
git commit -a -m "Project setup and removed personal file"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good description 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your feedback, Rafael! I indeed did learn about escaping characters after submitting the assignment 😅
I ended up using it later for some practice scripts and customizing my bash prompt 🤓

sleep 3
ls -l resources/
echo "Setup javascript..."
mv src/program.java src/program.js
# [ERROR] "bash: !': event not found" if exclamation mark included, hence removal

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. There are some workarounds for this error. You could escape it like this:

echo "console.log('JavaScript works\!');" > src/program.js

The \ is very common for being explicit that the next character should be used as is, and not be used here as an event (in this case, it seems to be an history expansion)

echo "console.log('JavaScript works');" > src/program.js
node src/program.js
git commit -a -m "Setup javascript environment"
ls -l $HOME/
echo "All done!"
2 changes: 1 addition & 1 deletion task-2/github-username.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<paste here your github username>
jivvyjams