Browse Source

fix(to-git-or-not-to-git-remake): changed the exercise so that it is doable

pull/2023/head
miguel 12 months ago committed by MSilva95
parent
commit
6fe1bcf2b2
  1. 2
      sh/tests/solutions/to-git-or-not-to-git.sh
  2. 18
      subjects/to-git-or-not-to-git/README.md

2
sh/tests/solutions/to-git-or-not-to-git.sh

@ -1,2 +1,2 @@
#!/usr/bin/env bash
curl -s "https://$DOMAIN/api/graphql-engine/v1/graphql" --data '{"query":"{user(where:{login:{_eq:\"'$USERNAME'\"}}){id}}"}' | jq '.data.user[0].id'
curl -s "https://$DOMAIN/assets/superhero/all.json" | jq -r '.[] | select(.id==170) | "\(.name)\n\(.powerstats.power)\n\(.appearance.gender)"'

18
subjects/to-git-or-not-to-git/README.md

@ -1,21 +1,17 @@
## to-git-or-not-to-git-?
## to-git-or-not-to-git
### Instructions
Write in a file `to-git-or-not-to-git.sh` the command that isolates your Gitea `id`.
Write in a file `to-git-or-not-to-git.sh` the command that will show the `name`, `power` and `gender` of the superhero with the `id: 170`.
Only the numbers will appear.
- Where to look : [superhero](<https://((DOMAIN))/assets/superhero/all.json>)
Here is the base command that needs to be adapted with your username and more :
```
curl -s https://((DOMAIN))/api/graphql-engine/v1/graphql --data '{"query":"{user(where:{login:{_eq:\"choumi\"}}){id}}"}'
```
### Usage
The output should be exactly like the example below:
```console
$ bash to-git-or-not-to-git.sh
231748
Chameleon
28
Male
$
```

Loading…
Cancel
Save