Changeset 6961


Ignore:
Timestamp:
11/06/24 16:53:24 (3 months ago)
Author:
lbastien
Message:

Made the model script able to handle local git repositories.

Git repositories are often located on remote servers, but they might also be
located on the same machine, in which case, git refuses to clone them if they
are owned by a different user. This commit makes it possible for the model
script to handle local git repositories owned by other users (in this case, it
does a "cp -r" instead of a "git clone"). Here, local repositories are
identified by having an address that starts with "/" or "./".

Author: Lucas Bastien (IGE).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modipsl/trunk/util/model

    r6728 r6961  
    405405    [[ ${zp} = 'git' ]] && \ 
    406406     { 
    407         c_c='(cd '${d_m}/${zl}' ; '${zp}'  clone  '${m_s[${qi}]}' '${zd}  ;  
     407        c_c='(cd '${d_m}/${zl}' ; ' 
     408        if [[ ${m_s[${qi}]} == /* || ${m_s[${qi}]} == ./* ]]; then 
     409            c_c=${c_c}' cp -r' 
     410        else 
     411            c_c=${c_c}' '${zp}' clone' 
     412        fi 
     413        c_c=${c_c}' '${m_s[${qi}]}' '${zd} 
    408414        [[ ${zt} != 'HEAD' ]] && { c_c=${c_c}' ; cd '${zd}' ; '${zp}' '${m_a}' '${zt}; } 
    409415        [[ ${zt} == 'HEAD' ]] && { c_c=${c_c}' ; cd '${zd}' ; '${zp}' '${m_a}' '${zc}; }  
    410         c_c=${c_c}')'; 
     416        c_c=${c_c}')'; 
    411417     } 
    412418#--- 
Note: See TracChangeset for help on using the changeset viewer.