Update Article “2023-04-12-un-outil-sans-daemon-pour-gérer-ses-artefacts-de-build”

This commit is contained in:
Quentin 2023-04-13 07:53:45 +00:00
parent 907b735c06
commit 7ffcbbeda1

View file

@ -160,6 +160,22 @@ const inject_list = manifest => {
(async () => inject_list(await albatros_tags()))()
```
Comme je disais au dessus, on a plusieurs types de builds. On va les classer selon cette regex :
```javascript
const release_semver = /^v?[0-9]+\.[0-9]+\.[0-9]+$/;
const prerelease_semver = /^v?[0-9]+\.[0-9]+\.[0-9]+-.*$/;
const find_cat = t => {
if (t.match(release_semver)) return 'release';
if (t.match(prerelease_semver)) return 'prerelease';
return 'dev'
};
const categorize = tags => tags.reduce((acc, t) => {
acc[find_cat(t)].push(t)
return acc
}, {'release': [], 'prerelease': [], 'dev': []});
```
Se pose alors la question