Skip to content

Commit cbb006e

Browse files
committed
Fix install script for hatchling build artifact
1 parent e7e3da4 commit cbb006e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ cd /opt/duet-simplyprint-connector
3131
python3 -m venv venv
3232
source venv/bin/activate
3333
pip install --upgrade pip setuptools wheel
34-
pip install simplyprint_duet3d
34+
pip install simplyprint-duet3d
3535
simplyprint-duet3d autodiscover
3636
simplyprint-duet3d install-as-service

simplyprint_duet3d/cli/install.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ def install_as_service():
1313
import tempfile
1414

1515
# Get the path of the service file
16-
service_file = os.path.join(sys.prefix, 'simplyprint-duet3d.service')
17-
18-
service_content = None
16+
parent_folder = os.path.dirname(os.path.abspath(__file__))
17+
service_file = os.path.join(parent_folder, '../../simplyprint-duet3d.service')
1918

2019
# Read the content of the service file
2120
with open(service_file, 'r') as file:
@@ -46,9 +45,9 @@ def install_as_service():
4645
subprocess.run(['sudo', 'systemctl', 'daemon-reload'])
4746

4847
# Enable the service
49-
subprocess.run(['sudo', 'systemctl', 'enable', 'simplyprint-connector'])
48+
subprocess.run(['sudo', 'systemctl', 'enable', 'simplyprint-duet3d'])
5049

5150
# Start the service
52-
subprocess.run(['sudo', 'systemctl', 'start', 'simplyprint-connector'])
51+
subprocess.run(['sudo', 'systemctl', 'start', 'simplyprint-duet3d'])
5352

5453
print('The SimplyPrint Connector has been installed as a systemd service.')

0 commit comments

Comments
 (0)