Question 1
You are working on an Angular project and you need to scaffold a base skeleton.
Write a script scaffold.sh that creates the following filesystem structure. It should take one command line argument, which can be local or prod. Accordingly, it should choose which environment the symlink points to.
If $1 is given as prod, your script should scaffold this:
src/
├── app/
│ └── index.html
└── environments/
├── environment.local.ts
├── environment.prod.ts
└── environment.ts -> environment.prod.ts
If $1 is given as local, your script should scaffold this instead:
src/
├── app/
│ └── index.html
└── environments/
├── environment.local.ts
├── environment.prod.ts
└── environment.ts -> environment.local.ts
Instructions
- Write your script in
scaffold.sh. It will be given the command line argumentprodorlocaland should use it to create the symlink. - It should create the files and folders in the current directory.
- Files can be empty files.
- If the link is not correctly created, the test fails and no marks are given.
Hints
- Symlinks store the path relative to the link itself.
The test lists what your script created, with -> after each symlink.