GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — odootools/post-checkout at common · vertelab/odootools

Expand file tree

/

post-checkout

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
52 lines (47 loc) · 2.07 KB
/

post-checkout

Copy path

File metadata and controls

52 lines (47 loc) · 2.07 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# .git/hooks/post-checkout
# git checkout 17.0 will run this script
# Get the current branch name
branch_name=$(git rev-parse --abbrev-ref HEAD)
export branch_name
# Get the repository name
repo_name=$(basename `git rev-parse --show-toplevel`)
export repo_name
# sudo pip3 install preprocessor ; preprocessor --help
## Python
#
# Python (*.p.py), Javascript (*.p.js), csv (*.p.csv)
#
# # #if VERSION == "main"
# ...
# # #elif VERSION == 17.0
# ...
# # #else
# ...
# # #endif#
#
# Replacement:
#
# ##VERSION## -> 17.0
# ##REPO## -> odoo-base
#
find . -name "*.p.py" | xargs -I {} sh -c 'base=$(echo {}); preprocess -D VERSION=${branch_name} -D REPO=${repo_name} -o "${base%.p.py}.py" "{}"'
find . -name "*.py" ! -name "*.p.py" | xargs -I {} perl -i -p -e "s/##VERSION##/${branch_name}/g" {}
find . -name "*.py" ! -name "*.p.py" | xargs -I {} perl -i -p -e "s/##REPO##/${repo_name}/g" {}
## JS
find . -name "*.p.js" | xargs -I {} sh -c 'base=$(echo {}); preprocess -D VERSION=${branch_name} -D REPO=${repo_name} -o "${base%.p.js}.js" "{}"'
find . -name "*.js" ! -name "*.p.js" | xargs -I {} perl -i -p -e "s/##VERSION##/${branch_name}/g" {}
find . -name "*.js" ! -name "*.p.js" | xargs -I {} perl -i -p -e "s/##REPO##/${repo_name}/g" {}
## CSV
find . -name "*.p.csv" | xargs -I {} sh -c 'base=$(echo {}); preprocess -D VERSION=${branch_name} -D REPO=${repo_name} -o "${base%.p.csv}.csv" "{}"'
find . -name "*.csv" ! -name "*.p.csv" | xargs -I {} perl -i -p -e "s/##VERSION##/${branch_name}/g" {}
find . -name "*.csv" ! -name "*.p.csv" | xargs -I {} perl -i -p -e "s/##REPO##/${repo_name}/g" {}
## XML
#
# <!-- #if VERSION == 17.0 -->
# ...
# <!-- #endif -->
#
find . -name "*.p.xml" | xargs -I {} sh -c 'base=$(echo {}); preprocess -D VERSION=${branch_name} -D REPO=${repo_name} -o "${base%.p.xml}.xml" "{}"'
find . -name "*.xml" ! -name "*.p.xml" | xargs -I {} perl -i -p -e "s/##VERSION##/${branch_name}/g" {}
find . -name "*.xml" ! -name "*.p.xml" | xargs -I {} perl -i -p -e "s/##REPO##/${repo_name}/g" {}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.