Skip to content

Commit 59db3a6

Browse files
committed
Add Windows compatibility
1 parent fb46daa commit 59db3a6

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

setup.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,9 @@
3131
package_dir={"": "src"},
3232
packages=setuptools.find_packages(where="src"),
3333
python_requires=">=3.6",
34-
scripts=["src/bin/qfieldcloud-cli"],
34+
entry_points={
35+
"console_scripts": [
36+
"qfieldcloud-cli = bin.qfieldcloud_cli:cli"
37+
]
38+
},
3539
)

src/bin/__init__.py

Whitespace-only changes.
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import collections
44
import json
5+
import platform
56
from enum import Enum
67
import sys
78

@@ -134,7 +135,10 @@ def login(ctx, username, password) -> None:
134135
"Put the token in your in the environment using the following code, "
135136
"so you do not need to write your username and password again:"
136137
)
137-
log(f'export QFIELDCLOUD_TOKEN="{user_data["token"]}"')
138+
if platform.system() == 'Windows':
139+
log(f'set QFIELDCLOUD_TOKEN={user_data["token"]}')
140+
else:
141+
log(f'export QFIELDCLOUD_TOKEN="{user_data["token"]}"')
138142

139143

140144
@cli.command()

0 commit comments

Comments
 (0)