Skip to content

Commit 6809238

Browse files
author
Timothy MacDonald
authored
fix(cdk): place Python component binary in component root (#1419)
**Summary** The python pyinstaller build command was creating the component binary in subdirectory, not the component root directory. This prevented the lacework cli from executing the component. **How did you test this change?** 1. compiled the lacework cli 2. tested the creation of a new python component with scaffolding 3. tested that the cli could execute the component after build https://lacework.atlassian.net/browse/GROW-2491 Signed-off-by: Timothy MacDonald <[email protected]>
1 parent 2ccd309 commit 6809238

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cli/cmd/component_dev.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,17 +369,24 @@ func cdkPythonScaffolding(component *lwcomponent.Component) error {
369369
return err
370370
}
371371

372-
_, err = f.WriteString("build = \"poetry run pyinstaller src/")
372+
_, err = f.WriteString("build.shell = \"poetry run pyinstaller src/")
373373
if err != nil {
374374
return err
375375
}
376376
_, err = f.WriteString(fmt.Sprintf(
377-
"%s/__main__.py --collect-submodules application -D --name %s --distpath .\"\n",
377+
"%s/__main__.py --collect-submodules application -D --name %s --distpath dist;",
378378
component.Name, component.Name,
379379
))
380380
if err != nil {
381381
return err
382382
}
383+
_, err = f.WriteString(fmt.Sprintf(
384+
" mv dist/%s/* .\"\n",
385+
component.Name,
386+
))
387+
if err != nil {
388+
return err
389+
}
383390
_, err = f.WriteString(fmt.Sprintf(
384391
"clean = \"rm -r build/ %s %s.spec\"\n",
385392
component.Name, component.Name,

0 commit comments

Comments
 (0)