fix some minor bugs
This commit is contained in:
		| @@ -24,11 +24,12 @@ class PiSugar: | |||||||
|             return None |             return None | ||||||
|         cmd = self.command_template.replace("command", command) |         cmd = self.command_template.replace("command", command) | ||||||
|         try: |         try: | ||||||
|             result = subprocess.run(cmd, text=True, capture_output=True) |             result = subprocess.run(cmd, shell=True, text=True, capture_output=True) | ||||||
|             if result.returncode != 0: |             if result.returncode != 0: | ||||||
|                 print(f"Command failed with {result.stderr}") |                 print(f"Command failed with {result.stderr}") | ||||||
|                 return None |                 return None | ||||||
|             return result |             output = result.stdout.strip() | ||||||
|  |             return output | ||||||
|         except Exception as e: |         except Exception as e: | ||||||
|             logger.error(f"Error executing command: {e}") |             logger.error(f"Error executing command: {e}") | ||||||
|             return None |             return None | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user