Changeset 11033


Ignore:
Timestamp:
2019-05-21T22:36:30+02:00 (17 months ago)
Author:
nicolasmartin
Message:

Modify the shell code in order to run as expected on different OS (Linux or MacOS)

Location:
NEMO/trunk/doc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/doc/manual_build.sh

    r11013 r11033  
    1616fi 
    1717 
    18 ## Avoid the use of shell builtin echo (for -e option) 
    19 alias echo='/bin/echo -e' 
    20  
    2118# Source shared functions 
    2219. tools/shr_func.sh 
     
    3128## Retrieve figures if not already there 
    3229if [ ! -d latex/figures ]; then 
    33    echo "Downloading of shared figures and logos\n" 
     30   printf "Downloading of shared figures and logos\n\n" 
    3431   svn co https://forge.ipsl.jussieu.fr/nemo/svn/utils/figures latex/figures > /dev/null 
    3532fi 
     
    4340 
    4441for model in $models; do 
    45    echo $model"\n" 
     42   echo $model 
    4643   clean $model; build $model 
    47    echo "\t"'¤ End of building run' 
    48    echo "\t\t"'The export should be available at root' 
    49    echo "\t\t"'If not check LaTeX log in ./latex/'$model'/main/'$model'_manual.log'"\n" 
     44   printf "\t¤ End of building run\n" 
     45   printf "\t  The export should be available at root\n" 
     46   printf "\t  If not check LaTeX log in ./latex/$model/main/${model}_manual.log\n" 
    5047done 
    5148 
  • NEMO/trunk/doc/tools/shr_func.sh

    r11008 r11033  
    11#!/bin/sh 
    22 
    3 alias echo='/bin/echo -e' 
     3 
     4## Default options for GNU find (Linux OS) 
     5find_pre=''; find_suf='-regextype posix-extended' 
     6 
     7## Test OS to tweak the options in find command for working in extended mode everywhere 
     8[ '$( uname )' = 'Darwin' ] && { find_pre='-E'; find_suf=''; } 
    49 
    510clean() { 
    6    ## Not sure if this step is needed, guess latexmk should be able to detect a change 
    7         echo "\t¤ Clean previous build" 
     11    ## Not sure if this step is needed, guess latexmk should be able to detect a change 
     12    printf "\t¤ Clean previous build\n" 
    813 
    9         ## Delete temp files from previous build 
    10    echo "\t\t- delete all temporary files (.aux, .bbl, ...)" 
    11         find latex/$1 -regextype posix-extended                                                        \ 
    12                       -regex     ".*\.(aux|bbl|blg|dvi|fdb|fls|idx|ilg|ind|log|maf|mtc|out|pdf|toc).*" \ 
    13                       -exec      rm {} \; 
     14    ## Delete temp files from previous build 
     15    printf "\t  - delete all temporary files (.aux, .bbl, ...)\n" 
     16    find ${find_pre} latex/$1 ${find_suf}                                                                \ 
     17                         -regex ".*\.(aux|bbl|blg|dvi|fdb|fls|idx|ilg|ind|log|maf|mtc|out|pdf|toc)" \ 
     18                              -exec rm {} \; 
    1419 
    15         ## Remove minted folders 
    16    echo "\t\t- remove pygments input hash files (\"_minted\" folders)" 
    17         find latex/$1 -type d -name '_minted*' -exec rm -r {} \; 2> /dev/null 
     20    ## Remove minted folders 
     21    printf "\t  - remove pygments input hash files (\"_minted\" folders)\n" 
     22    find latex/$1 -type d -name '_minted*' -exec rm -r {} \; 2> /dev/null 
    1823 
    19         ## HTML exports 
    20    #echo '   - possible HTML export' 
    21         #find latex/$1 -type d -name 'html*'    -exec rm -r {} \; 
     24    ## HTML exports 
     25    #printf '   - possible HTML export' 
     26    #find latex/$1 -type d -name 'html*'    -exec rm -r {} \; 
    2227 
    23    echo 
     28    echo 
    2429} 
    2530 
    2631build() { 
    27         echo "\t¤ Generation of the PDF format\n" 
    28         cd latex/$1/main 
    29         latexmk $opts $1'_manual' 1> /dev/null 
    30         [ -f $1'_manual'.pdf ] && mv $1'_manual'.pdf ../../.. 
    31         cd - > /dev/null 
    32    echo 
     32    printf "\t¤ Generation of the PDF format\n" 
     33    cd latex/$1/main 
     34    latexmk $opts $1'_manual' 1> /dev/null 
     35    [ -f $1'_manual'.pdf ] && mv $1'_manual'.pdf ../../.. 
     36    cd - > /dev/null 
     37    echo 
    3338} 
Note: See TracChangeset for help on using the changeset viewer.