Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Cloud9: Added dedicated workspace and use symlink to homeassistant config. #178

Merged
merged 5 commits into from
Sep 3, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cloud9.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $ sudo hassbian-config upgrade cloud9
Description | Command/value
:--- | :---
Running as: | homeassistant
Default workspace: | /home/homeassistant/
Default workspace: | /home/homeassistant/c9workspace/
Default port: | 8181
Start service: | `sudo systemctl start [email protected]`
Stop service: | `sudo systemctl stop [email protected]`
Expand Down
6 changes: 5 additions & 1 deletion package/opt/hassbian/suites/cloud9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ sudo -u homeassistant -H /bin/bash << EOF
printf "Downloading and installing Cloud9 SDK...\\n"
git clone git://github.com/c9/core.git /opt/c9sdk
bash /opt/c9sdk/scripts/install-sdk.sh
echo '{"projecttree": {"@showhidden": true,"@hiddenFilePattern": ".n*,*c9*,.b*,.p*,.w*,*.db"}}' | tee /home/homeassistant/.c9/user.settings
echo '{"projecttree": {"@showhidden": false,"@hiddenFilePattern": ".n*,*c9*,.b*,.p*,.w*,*.db"}}' | tee /home/homeassistant/.c9/user.settings
mkdir /home/homeassistant/c9workspace
ln -s /home/homeassistant/.homeassistant/ /home/homeassistant/c9workspace
ln -s /home/homeassistant/.c9 /home/homeassistant/c9workspace
mv /home/homeassistant/.homeassistant /home/homeassistant/homeassistant
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a terrible idea. Create a symlink instead and both the default and the change will function.
We should always avoid changing defaults since other projects can assume that they are correct.

EOF

echo "Copying Cloud9 service file..."
Expand Down
2 changes: 1 addition & 1 deletion package/opt/hassbian/suites/files/cloud9.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ After=network-online.target
[Service]
Type=simple
User=homeassistant
ExecStart=/opt/c9sdk/server.js -l 0.0.0.0 -a : -w /home/homeassistant
ExecStart=/opt/c9sdk/server.js -l 0.0.0.0 -a : -w /home/homeassistant/c9workspace
[Install]
WantedBy=multi-user.target