summaryrefslogtreecommitdiff
path: root/src/intellij/update.sh
blob: eb6fea782f379afaac8e84d701cff462c56cb8bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
#
# Updates the .SAMPLE files with the current project files.
#

set -e
export SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"

echo "About to create overwrite the .ipr.SAMPLE and .iml.SAMPLE files with the current project files. Press enter to continue or CTRL-C to cancel."
read

for f in "$SCRIPT_DIR"/*.{iml,ipr}; do
  cp $f $f.SAMPLE
done

for f in "$SCRIPT_DIR"/*.SAMPLE; do
  g=${f%.SAMPLE}
  if [[ ! -f $g ]]; then
    echo "Stale sample file, deleting $f"
    rm $f
  fi
done