diff --git a/ush/prune_4nco_global.sh b/ush/prune_4nco_global.sh index 9c2a68b1ac..793de51c70 100755 --- a/ush/prune_4nco_global.sh +++ b/ush/prune_4nco_global.sh @@ -46,11 +46,13 @@ echo " " cd $topdir rlist="regression src/GSD unit-tests" for type in $rlist; do - git $string ${type}* - rc=$? - if [[ $rc -ne 0 ]]; then - echo "***ERROR* git $string ${type}" - exit + if [ -e $type ]; then + git $string ${type}* + rc=$? + if [[ $rc -ne 0 ]]; then + echo "***ERROR* git $string ${type}" + exit + fi fi if [[ "$mode" = "restore" ]]; then git checkout ${type}* @@ -67,11 +69,13 @@ done cd $topdir/doc rlist="EnKF_user_guide GSI_user_guide README.discover Release_Notes.fv3gfs_da.v15.0.0.txt Release_Notes.gfsda.v16.0.0.txt" for type in $rlist; do - git $string ${type}* - rc=$? - if [[ $rc -ne 0 ]]; then - echo "***ERROR* git $string ${type}" - exit + if [ -e $type ]; then + git $string ${type}* + rc=$? + if [[ $rc -ne 0 ]]; then + echo "***ERROR* git $string ${type}" + exit + fi fi if [[ "$mode" = "restore" ]]; then git checkout ${type}* @@ -88,11 +92,13 @@ done cd $topdir/jobs rlist="JGDAS_EFSOI" for type in $rlist; do - git $string ${type}* - rc=$? - if [[ $rc -ne 0 ]]; then - echo "***ERROR* git $string ${type}" - exit + if [ -e $type ]; then + git $string ${type}* + rc=$? + if [[ $rc -ne 0 ]]; then + echo "***ERROR* git $string ${type}" + exit + fi fi if [[ "$mode" = "restore" ]]; then git checkout ${type}* @@ -109,11 +115,13 @@ done cd $topdir/scripts rlist="exurma2p5_gsianl.sh exgdas_efsoi" for type in $rlist; do - git $string ${type}* - rc=$? - if [[ $rc -ne 0 ]]; then - echo "***ERROR* git $string ${type}" - exit + if [ -e $type ]; then + git $string ${type}* + rc=$? + if [[ $rc -ne 0 ]]; then + echo "***ERROR* git $string ${type}" + exit + fi fi if [[ "$mode" = "restore" ]]; then git checkout ${type}* @@ -130,11 +138,13 @@ done cd $topdir/ush rlist="Get_Initial_Files comenkf comgsi gfs_truncate_enkf llsub para refactor_4nco_global run_arw rungsi sub" for type in $rlist; do - git $string ${type}* - rc=$? - if [[ $rc -ne 0 ]]; then - echo "***ERROR* git $string ${type}" - exit + if [ -e $type ] ; then + git $string ${type}* + rc=$? + if [[ $rc -ne 0 ]]; then + echo "***ERROR* git $string ${type}" + exit + fi fi if [[ "$mode" = "restore" ]]; then git checkout ${type}* @@ -151,11 +161,13 @@ done cd $topdir/util rlist="Aero Analysis_Utilities Baseline Config Conventional_Monitor Correlated_Obs DTC EFSOI Fit2Obs_Scorecard FOV GEN_BE_V2.0 GMI_BUFR MODIS_AOD Minimization_Monitor/data_xtrct Minimization_Monitor/image_gen Minimization_Monitor/nwprod/nam_minmon Misc NCEP NMC_Bkerror Ozone_Monitor/image_gen README Radar_Monitor Radiance_bias_correction_Utilities Radiance_Monitor/nwprod/nam_radmon Radiance_Utilities Single_Observation bufr_tools global_angupdate gsienvreport.sh python_utilities radar_process zero_biascoeff" for type in $rlist; do - git $string ${type}* - rc=$? - if [[ $rc -ne 0 ]]; then - echo "***ERROR* git $string ${type}" - exit + if [ -e $type ]; then + git $string ${type}* + rc=$? + if [[ $rc -ne 0 ]]; then + echo "***ERROR* git $string ${type}" + exit + fi fi if [[ "$mode" = "restore" ]]; then git checkout ${type}* @@ -172,11 +184,13 @@ done cd $topdir/util/EnKF rlist="arw python_utilities" for type in $rlist; do - git $string ${type}* - rc=$? - if [[ $rc -ne 0 ]]; then - echo "***ERROR* git $string ${type}" - exit + if [ -e $type ]; then + git $string ${type}* + rc=$? + if [[ $rc -ne 0 ]]; then + echo "***ERROR* git $string ${type}" + exit + fi fi if [[ "$mode" = "restore" ]]; then git checkout ${type}* @@ -193,11 +207,13 @@ done cd $topdir/util/EnKF/gfs/src rlist="adjustps misc preproc gribmean recenterncio_hybgain recenternemsiop_hybgain getnstensmeanp adderrspec getsfcnstensupdp" for type in $rlist; do - git $string ${type}* - rc=$? - if [[ $rc -ne 0 ]]; then - echo "***ERROR* git $string ${type}" - exit + if [ -e $type ]; then + git $string ${type}* + rc=$? + if [[ $rc -ne 0 ]]; then + echo "***ERROR* git $string ${type}" + exit + fi fi if [[ "$mode" = "restore" ]]; then git checkout ${type}*