lima-vm / lima-vm/lima

Reduce the amount of duplicated code in hack

Open
#3,447 8 comments 0 reactions 0 assignees View on GitHub
expert help wanted kind/refactoring
Dominant language
Go
Stars
21.9k
Forks
957
Avg merge
2d 6h
Merged PRs (30d)
53

Description

### Description

Currently there is an almost identical copy of the update script, for each distribution.

```
424 hack/cache-common-inc.sh
287 hack/update-template-almalinux-kitten.sh
287 hack/update-template-almalinux.sh
311 hack/update-template-alpine.sh
294 hack/update-template-archlinux.sh
274 hack/update-template-centos-stream.sh
440 hack/update-template-debian.sh
283 hack/update-template-fedora.sh
364 hack/update-template-opensuse.sh
232 hack/update-template-oraclelinux.sh
302 hack/update-template-rocky.sh
258 hack/update-template.sh
458 hack/update-template-ubuntu.sh
4214 total
```

These should be made into a program with config instead, to share common functionality.

It would probably be better to convert them from shell scripts into a language like Python (or Go).

The current scripts are hard to write and test, and don't really have any unit tests (only functional)

---

It also fails on older platforms, due to not checking the versions or the functionality of the tools.

```
curl: unknown --write-out variable: 'json'
curl: unknown --write-out variable: 'header_json'
parse error: Expected value before ',' at line 2, column 10
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.