forked from quentin/quentin.dufour.io
Update Article “2023-04-12-un-outil-sans-daemon-pour-gérer-ses-artefacts-de-build”
This commit is contained in:
parent
907b735c06
commit
7ffcbbeda1
1 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue