Skip to content

Commit 548c06b

Browse files
author
OutsourcedGuru
committed
v1.1.2 Reverted to earlier style of putting files into uploads
1 parent 1494b20 commit 548c06b

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

octoprint_gitfiles/__init__.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ def on_api_command(self, command, data):
4141

4242
self._logger.info("`git {arg1}`".format(**data))
4343
uploads = self._settings.global_get_basefolder("uploads")
44-
gitfilesFolder = os.path.expanduser("~") + "/gitfiles"
44+
gitfilesFolder = uploads + "/github"
4545
self._logger.info(gitfilesFolder)
4646
if not self._settings.get(["initialized"]):
4747
self._logger.info("Not initialized")
48-
# These run if it's not been initialized before this
48+
# These run if it's not been initialized before this
4949
try:
5050
self._logger.info("Creating the gitfiles folder...")
5151
os.mkdir(gitfilesFolder, 0755)
@@ -57,8 +57,9 @@ def on_api_command(self, command, data):
5757
self._logger.info("Initializing the uploads folder...")
5858
output = call(["git", "init"], cwd=gitfilesFolder)
5959
self._logger.info(output)
60-
self._settings.setBoolean(["plugins", "gitfiles", "initialized"], True)
61-
self._settings.save()
60+
s = settings()
61+
s.setBoolean(["plugins", "gitfiles", "initialized"], True)
62+
s.save()
6263
except OSError as e:
6364
self._logger.info("git init failed")
6465
return
@@ -69,13 +70,6 @@ def on_api_command(self, command, data):
6970
except OSError as e:
7071
self._logger.info("git add remote origin failed")
7172
return
72-
try:
73-
self._logger.info("Creating the symlink...")
74-
os.symlink(gitfilesFolder, uploads + "/github")
75-
self._logger.info("Created symlink")
76-
except OSError as e:
77-
self._logger.info("Creation of symlink failed")
78-
return
7973
# This one runs regardless of whether or not it's been previously initialized
8074
try:
8175
self._logger.info("-- git pull origin master ---------------------------------------------------")

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
plugin_name = "GitFiles"
1515

1616
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
17-
plugin_version = "1.1.1"
17+
plugin_version = "1.1.2"
1818

1919
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
2020
# module

0 commit comments

Comments
 (0)