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
48 changes: 47 additions & 1 deletion task-1/setup.sh
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
# Write your code here
#!/bin/bash
echo "Creating project..."
mkdir project
cd project
git init
touch README.md
mkdir resources
touch settings.conf
mkdir src
cd resources

Choose a reason for hiding this comment

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

Instead of cd-ing into the directory, you can also create/access files by using a path, e.g.:

touch resources/xyz.txt

touch "family picture.jpg"
touch icon.png
touch logo.png
cd ..
cd src
mkdir database
mkdir profile
touch program.java
cd ..
git add .
git commit -m "Initial commit"
git push

Choose a reason for hiding this comment

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

This push is not asked for in the instructions. As it stands, it produces an error message because no remote repository has been defined:

fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

sleep 3
echo "Setup project..."
echo "Welcome to my project" > README.md
cd src
rm -r profile
cd ..
cd resources
rm "family picture.jpg"

Choose a reason for hiding this comment

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

Here, you have correctly used quotes for the file name containing a space. However, that file was not created. Hence, the error message:

rm: cannot remove 'family picture.jpg': No such file or directory

cd ..
git add .
git commit -m "write welcome text to README, remove profile directory , remove family_picture.jpg"
git push

Choose a reason for hiding this comment

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

Remove the push

sleep 3
cd resources
echo "Setup javascript..."
mv program.java program.js
echo "console.log('JavaScript works!');" > program.js
node program.js
cd ..
git add .
git commit -m "rename program.java to program.js , add log line to program.js"
git push
cd ~
ls -la
echo "All done!"
1 change: 0 additions & 1 deletion task-2/github-username.txt

This file was deleted.

1 change: 1 addition & 0 deletions task-2/halyna1995.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
halyna1995