generated from home-assistant/addons-example
-
Notifications
You must be signed in to change notification settings - Fork 2
/
copy_to_dev.sh
executable file
·21 lines (16 loc) · 979 Bytes
/
copy_to_dev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Define source and target directories
src_dir="GridboxConnectorAddon-edge"
target_dir="GridboxConnectorAddon-dev"
# Copy all files from source to target directory, excluding config.yml and build.yml
rsync -av --delete --exclude='config.yaml' --exclude='build.yaml' --exclude='__pycache__' --exclude='.pytest_cache' $src_dir/ $target_dir/
yaml_datei="GridboxConnectorAddon-dev/config.yaml"
current_version=$(yq -e '.version' $yaml_datei)
echo "Current version: $current_version"
new_version=$(jq -r '.version' GridboxConnectorAddon-dev/rootfs/share/cloudSettings.json)
echo "New version: $new_version"
# Update the version in the config.yaml file
#sed -i "s/version: \"$current_version\"/version: \"$new_version\"/g" $yaml_datei
#sed -i "" "s/version: \"$current_version\"/version: \"$new_version\"/g" $yaml_datei
#sed -i "s/version: \"$current_version\"/version: \"$new_version\"/g" $yaml_datei
sed -i "s/^version: \".*\"/version: \"$new_version\"/" $yaml_datei