Skip to content

Commit d069435

Browse files
committed
Try to fix the resulting executable path
1 parent c372d06 commit d069435

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.github/workflows/build_py_tools.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ jobs:
5959
# shell: pwsh
6060
# run: |
6161
# ./.github/pytools/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/get.exe
62-
# - name: Test binaries
63-
# shell: bash
64-
# run: |
65-
# ./${{ env.DISTPATH }}/get${{ matrix.EXTEN }} -h
62+
- name: Test binaries
63+
shell: bash
64+
run: |
65+
./${{ env.DISTPATH }}/get${{ matrix.EXTEN }} -h
6666
- name: Archive artifact
6767
uses: actions/upload-artifact@master
6868
with:

tools/get.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
if 'Windows' in platform.system():
3636
import requests
3737

38-
current_dir = os.path.dirname(os.path.realpath(unicode(__file__)))
38+
# determine if application is a script file or frozen exe
39+
if getattr(sys, 'frozen', False):
40+
current_dir = os.path.dirname(os.path.realpath(unicode(sys.executable)))
41+
elif __file__:
42+
current_dir = os.path.dirname(os.path.realpath(unicode(__file__)))
43+
44+
#current_dir = os.path.dirname(os.path.realpath(unicode(__file__)))
3945
dist_dir = current_dir + '/dist/'
4046

4147
def sha256sum(filename, blocksize=65536):
@@ -222,7 +228,11 @@ def identify_platform():
222228
identified_platform = identify_platform()
223229
print('Platform: {0}'.format(identified_platform))
224230
tools_to_download = load_tools_list(current_dir + '/../package/package_esp32_index.template.json', identified_platform)
231+
is_test = (sys.argv[1] == '-h')
225232
mkdir_p(dist_dir)
226233
for tool in tools_to_download:
227-
get_tool(tool)
234+
if is_test:
235+
print('Install: {0}'.format(tool['archiveFileName']))
236+
else:
237+
get_tool(tool)
228238
print('Platform Tools Installed')

0 commit comments

Comments
 (0)