To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

README.md 1.64 KB
Newer Older
scmalte's avatar
scmalte committed
1
2
3
4
5
6
7
# README

## Prerequisites

* Script `rename_to_legi.sh`:
  * https://stedolan.github.io/jq/
  * Download `jq` and add to path
scmalte's avatar
scmalte committed
8
  * TODO: Re-implement shell script in Python
scmalte's avatar
scmalte committed
9
10
11
12
13

## Tidying up files and directories

* `cx-dump_bonus-exercise-1_2020-04-17.zip` contains the latest submission from each user

scmalte's avatar
scmalte committed
14
* Execute commands on the level of the user directories, e.g. in `./bonus_exercise_1`, so that, e.g. `./bonus_exercise_1/<user>` are the individual user directories
scmalte's avatar
scmalte committed
15
16
17
18
19
20
21
22

* Assumption: relevant files per submission are `<user>/details.json` and `<user>/files/main.cpp`, whereas all other files and directories can be deleted:

* Delete irrelevant files, and directory `cx_data`:

  ```plain
  $ cd ./bonus_exercise_1

scmalte's avatar
scmalte committed
23
  $ find -type f ! \( -iname details.json -or -iname main.cpp \) -delete -print
scmalte's avatar
scmalte committed
24
  
scmalte's avatar
scmalte committed
25
  $ find . -type d -iname cx_data -delete -print
scmalte's avatar
scmalte committed
26
27
28
29
30
31
32
  ```

* Move `<user>/files/main.cpp` to `<user>/main.cpp` and delete the (now empty) directory `<user>/files`:

  ```plain
  $ cd ./bonus_exercise_1

scmalte's avatar
scmalte committed
33
  $ find . -type d -iname files -execdir mv ./files/main.cpp . \; -print
scmalte's avatar
scmalte committed
34

scmalte's avatar
scmalte committed
35
  $ find . -type d -iname files -delete -print
scmalte's avatar
scmalte committed
36
37
  ```

scmalte's avatar
scmalte committed
38
39
* Now, each `<user>` directory should only have two files in it: `<user>/main.cpp` and `<user>/details.json`

scmalte's avatar
scmalte committed
40
41
42
43
44
45
46
47
48
## Renaming user directories

* Rename directories from user names to Legi numbers before submitting data to Moss, e.g. rename `scmalte` to `01-234-567`. The file `<user>/details.json` provides the Legi number.

* Execute `rename_to_legi.sh` from e.g. `./bonus_exercise_1/`:

  ```plain
  $ cd ./bonus_exercise_1

scmalte's avatar
scmalte committed
49
  $ <path-to-mossutils>/rename_to_legi.sh
scmalte's avatar
scmalte committed
50
51
52
  ```
  
  The script prompts for confirmation before the first renaming is executed.