-
Notifications
You must be signed in to change notification settings - Fork 0
Changed command structure to fix windows glide bug #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Daniel-Estoll
merged 7 commits into
develop
from
4504-p3-glide-bug-npx-poly-prepare-does-not-find-any-deployables-in-windows
Jun 16, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
65f0435
Changed command structure to fix windows glide bug
Daniel-Estoll 9217f4b
Added comment to explain strange syntax
Daniel-Estoll c7c1c52
Allowed directories to be specified in the command
Daniel-Estoll 2b42d6a
Updated excludeCommand quotations and comment
Daniel-Estoll 2562716
Updated version
Daniel-Estoll 351c826
Added package-lock.json
Daniel-Estoll dedee00
Merge remote-tracking branch 'origin/develop' into 4504-p3-glide-bug-…
Daniel-Estoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,26 +170,33 @@ export const getAllDeployableFilesWindows = ({ | |
| excludeDirs, | ||
| }: PolyDeployConfig): string[] => { | ||
| // To get the equivalent of grep in Windows we use a combination of `dir` and `findstr` | ||
| const includePattern = | ||
| includeFilesOrExtensions.length > 0 | ||
| ? includeFilesOrExtensions | ||
| .map((f) => (f.includes('.') ? f : `*.${f}`)) | ||
| .join(' ') | ||
| : '*'; | ||
| const excludePattern = excludeDirs.length > 0 ? excludeDirs.join('|') : ''; | ||
| const excludePattern = excludeDirs.length > 0 | ||
| ? excludeDirs | ||
| .map((f) => `\\${f}`) | ||
| .join(' ') : ''; | ||
| const pattern = | ||
| typeNames.length > 0 | ||
| ? typeNames.map((name) => `polyConfig: ${name}`).join('|') | ||
| ? typeNames.map((name) => `\\<polyConfig: ${name}\\>`).join(' ') | ||
| : 'polyConfig'; | ||
|
|
||
| // Using two regular quotes or two smart quotes throws "The syntax of the command is incorrect". | ||
| // For some reason, starting with a regular quote and leaving the end without a quote works. | ||
| const excludeCommand = excludePattern | ||
| ? ` | findstr /V /I "${excludePattern}"` | ||
| ? ` | findstr /V /I "${excludePattern}` | ||
| : ''; | ||
| const searchCommand = ` | findstr /M /I /F:/ /C:"${pattern}"`; | ||
| const searchCommand = ` | findstr /M /I /F:/ ${pattern}`; | ||
|
|
||
| let result: string[] = []; | ||
| for (const dir of includeDirs) { | ||
| const dirCommand = `dir /S /P /B ${includePattern} ${dir}`; | ||
| const includePattern = | ||
| dir === '.' | ||
| ? includeFilesOrExtensions | ||
| .map((f) => (f.includes('.') ? f : `*.${f}`)) | ||
| .join(' ') | ||
| : includeFilesOrExtensions | ||
| .map((f) => (f.includes('.') ? f : `${dir}*.${f}`)) | ||
| .join(' '); | ||
| const dirCommand = `dir ${includePattern} /S /P /B`; | ||
| const fullCommand = `${dirCommand}${excludeCommand}${searchCommand}`; | ||
| try { | ||
| const output = shell.exec(fullCommand).toString('utf8'); | ||
|
|
@@ -230,13 +237,13 @@ export const getAllDeployableFilesLinux = ({ | |
| export const getAllDeployableFiles = ( | ||
| config: Partial<PolyDeployConfig> = {}, | ||
| ): string[] => { | ||
| config.typeNames = config.typeNames = DeployableTypeEntries.map((p) => p[0]); | ||
| config.includeDirs = config.includeDirs = ['.']; | ||
| config.includeFilesOrExtensions = config.includeFilesOrExtensions = [ | ||
| config.typeNames = config.typeNames || DeployableTypeEntries.map((p) => p[0]); | ||
| config.includeDirs = config.includeDirs || ['.']; | ||
| config.includeFilesOrExtensions = config.includeFilesOrExtensions || [ | ||
| 'ts', | ||
| 'js', | ||
| ]; | ||
| config.excludeDirs = config.excludeDirs = [ | ||
| config.excludeDirs = config.excludeDirs || [ | ||
|
Comment on lines
+240
to
+246
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! |
||
| 'node_modules', | ||
| 'dist', | ||
| 'build', | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something seems off here. If we don't put the directory we're interested in are we going to be searching the same thing over and over again in this for loop?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
includedDirs only contains one item: ['.']. The command only ever runs once, and it runs in the directory that it is called in. If we actually have a specific directory we can add ${dir} before ${includePattern}, but right now if we just add '.' it will return folders and other things we don't want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Daniel-Estoll Include dirs happens to only contain one directory right now, but that could change in the future via configuration. Also I'm realizing there's a BUG in
getAllDeployableFileswhich we should fix. Do you mind taking care of it in your PR here?This code:
should actually be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.