File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,14 @@ FLEETCTL="${FLEETCTL:-fleetctl}"
1212FLEET_DRY_RUN_ONLY=" ${FLEET_DRY_RUN_ONLY:- false} "
1313FLEET_DELETE_OTHER_TEAMS=" ${FLEET_DELETE_OTHER_TEAMS:- true} "
1414
15- # Validate that global file contains org_settings
16- grep -Exq " ^org_settings:.*" " $FLEET_GLOBAL_FILE "
15+ # Check for existence of the global file in case the script is used
16+ # on repositories with team only yamls.
17+ if [ -f " $FLEET_GLOBAL_FILE " ]; then
18+ # Validate that global file contains org_settings
19+ grep -Exq " ^org_settings:.*" " $FLEET_GLOBAL_FILE "
20+ else
21+ FLEET_DELETE_OTHER_TEAMS=false
22+ fi
1723
1824# Copy/pasting raw SSO metadata into GitHub secrets will result in malformed yaml.
1925# Adds spaces to all but the first line of metadata keeps the multiline string in bounds.
@@ -28,7 +34,11 @@ if compgen -G "$FLEET_GITOPS_DIR"/teams/*.yml > /dev/null; then
2834 ! perl -nle ' print $1 if /^name:\s*(.+)$/' " $FLEET_GITOPS_DIR " /teams/* .yml | sort | uniq -d | grep . -cq
2935fi
3036
31- args=(-f " $FLEET_GLOBAL_FILE " )
37+ args=()
38+ if [ -f " $FLEET_GLOBAL_FILE " ]; then
39+ args=(-f " $FLEET_GLOBAL_FILE " )
40+ fi
41+
3242for team_file in " $FLEET_GITOPS_DIR " /teams/* .yml; do
3343 if [ -f " $team_file " ]; then
3444 args+=(-f " $team_file " )
You can’t perform that action at this time.
0 commit comments