3753ca30efbffcc41df4135cc015263284347607
Hanno Böck adapt wordpress helper scri...

Hanno Böck authored 4 years ago

1) #!/bin/bash
Hanno add helper script for wordp...

Hanno authored 4 years ago

2) #
3) # helper script for development only, creates version list
4) # of all supported wordpress versions + one future version
5) # for each major/minor combination
6) 
7) vers=$(curl -s https://api.wordpress.org/core/version-check/1.7/ | jq . | grep current | sed -e 's!^.*: "!!g' -e 's!",$!!g' | sort -ru)
8) 
9) safe=$(echo "$vers"|head -n 1)
10) 
Hanno Böck adapt wordpress helper scri...

Hanno Böck authored 4 years ago

11) echo '    "safe": "'"$safe"'",'
Hanno add helper script for wordp...

Hanno authored 4 years ago

12) 
Hanno Böck adapt wordpress helper scri...

Hanno Böck authored 4 years ago

13) echo -n '    "old_safe": "'
Hanno add helper script for wordp...

Hanno authored 4 years ago

14) for ver in $(echo "$vers"|tail -n +2); do
15) 
Hanno Böck adapt wordpress helper scri...

Hanno Böck authored 4 years ago

16) 	pre=$(echo "$ver" | sed -e 's:[0-9]*$::g')
17) 	post=$(echo "$ver" | sed -e 's:.*\.::g')
Hanno add helper script for wordp...

Hanno authored 4 years ago

18) 
Hanno Böck adapt wordpress helper scri...

Hanno Böck authored 4 years ago

19) 	((postadd=post+1))
Hanno add helper script for wordp...

Hanno authored 4 years ago

20) 
Hanno Böck adapt wordpress helper scri...

Hanno Böck authored 4 years ago

21) 	echo -n "$pre$postadd",
22) 	echo -n "$pre$post",
Hanno add helper script for wordp...

Hanno authored 4 years ago

23) 
24) done | sed -e 's:,$::g'
25)