Skip to content

Commit ef7294e

Browse files
authored
Merge pull request #14 from gri-gus/feature/force_build
Added builder for forced build.
2 parents 93e8394 + d1b4979 commit ef7294e

File tree

6 files changed

+40
-4
lines changed

6 files changed

+40
-4
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ After completing this step, the folder `com.bestdeveloper.mytestplugin.sdPlugin`
111111
streamdeck_sdk build -i com.bestdeveloper.mytestplugin.sdPlugin
112112
```
113113

114+
⚠️ If you are using Windows and receive an error, then use the command:
115+
116+
```shell
117+
streamdeck_sdk build -i com.bestdeveloper.mytestplugin.sdPlugin -F
118+
```
119+
114120
6. Install the `releases/{date}/com.bestdeveloper.mytestplugin.streamDeckPlugin` plugin into the Stream Deck
115121
application. Usually installed via double click.
116122

README.ru.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ streamdeck_sdk startproject
111111
streamdeck_sdk build -i com.bestdeveloper.mytestplugin.sdPlugin
112112
```
113113

114+
⚠️ Если вы используете Windows и получили ошибку, то используете команду:
115+
116+
```shell
117+
streamdeck_sdk build -i com.bestdeveloper.mytestplugin.sdPlugin -F
118+
```
119+
114120
6. Установите плагин `releases/{date}/com.bestdeveloper.mytestplugin.streamDeckPlugin` в приложение Stream Deck.
115121
Обычно устанавливается через двойной клик.
116122

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import setuptools
44

5-
VERSION = "1.1.1"
5+
VERSION = "1.1.2"
66
PACKAGE_DIR = "."
77
REQUIREMENTS_FILE = "./requirements.txt"
88
README = "README-PYPI.md"
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
streamdeck-sdk>=1.1.1
1+
streamdeck-sdk>=1.1.2

streamdeck_sdk/executable/assets/base_project/com.bestdeveloper.mytestplugin.sdPlugin/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"Description": "Open streamdeck_sdk github page.",
2424
"Icon": "assets/plugin_icon",
2525
"Name": "MyTestPlugin",
26-
"Version": "0.0.3",
26+
"Version": "0.0.4",
2727
"SDKVersion": 2,
2828
"OS": [
2929
{

streamdeck_sdk/executable/executable.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def main():
2121
parser = argparse.ArgumentParser(description="StreamDeckSDK")
2222
parser.add_argument("command")
2323
parser.add_argument("-i", default=None, required=False, type=str, help="Input file", )
24+
parser.add_argument('-F', action='store_true', help="Force build", )
2425
args = parser.parse_args()
2526
logger.info(args)
2627
command = args.command
@@ -29,7 +30,7 @@ def main():
2930
elif command == "build":
3031
if args.i is None:
3132
raise ValueError("Invalid value for -i param.")
32-
input_file = Path(args.i).resolve()
33+
input_file = str(Path(args.i).resolve())
3334

3435
now = datetime.now()
3536
dt = now.strftime("%Y_%m_%d_%H_%M_%S")
@@ -40,6 +41,11 @@ def main():
4041
[p.unlink() for p in BASE_DIR.rglob('*.py[co]')]
4142
[p.rmdir() for p in BASE_DIR.rglob('__pycache__')]
4243

44+
force = args.F
45+
if force:
46+
force_build(i=input_file, o=release_dir)
47+
return
48+
4349
os_name = platform.system()
4450
logger.info(os_name)
4551
if os_name == "Darwin":
@@ -52,3 +58,21 @@ def main():
5258
subprocess.run(
5359
[distribution_tool, "-b", "-i", input_file, "-o", release_dir],
5460
)
61+
62+
63+
def force_build(i: str, o: str) -> None:
64+
i = Path(i)
65+
o = Path(o)
66+
output_zip_base_name = o / i.name
67+
shutil.make_archive(
68+
base_name=str(output_zip_base_name.resolve()),
69+
format="zip",
70+
root_dir=str(i.parent.resolve()),
71+
base_dir=i.name,
72+
)
73+
output_zip_file_path = o / f"{i.name}.zip"
74+
output_plugin_file_path = o / i.name.replace(".sdPlugin", ".streamDeckPlugin")
75+
os.rename(
76+
str(output_zip_file_path.resolve()),
77+
str(output_plugin_file_path.resolve())
78+
)

0 commit comments

Comments
 (0)