Skip to content

Commit

Permalink
Merge pull request #13 from iterate-ch/Verify-Profiles
Browse files Browse the repository at this point in the history
Verify PList format
  • Loading branch information
dkocher authored Sep 15, 2022
2 parents e726903 + bd1b8e0 commit a38345a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/profiles-sanity-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Sanity check profiles

on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
sudo apt-get update
sudo apt-get install -y libplist-utils
- run: scripts/plist-test.sh .
32 changes: 32 additions & 0 deletions scripts/plist-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
#
# Copyright (c) 2022 iterate GmbH. All rights reserved.
# https://cyberduck.io/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
set -e

DIRECTORY=$1
if [ ! ${DIRECTORY} ]; then
DIRECTORY=$(dirname "$(cd -P -- "$(dirname -- "$0")" && pwd -P)")
fi
echo "Finding profiles in ${DIRECTORY}"

for path in ${DIRECTORY}/*.cyberduckprofile; do
filename=$(basename "${path}")
echo "XML Sanity check ${filename}"
MESSAGE=$(plistutil -i "${path}" -o /dev/null)
if [[ ${MESSAGE} =~ ^ERROR: ]]; then
echo ${MESSAGE}
exit 1
fi
done

0 comments on commit a38345a

Please sign in to comment.