-
Notifications
You must be signed in to change notification settings - Fork 47
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
Misc file tweaks #329
Misc file tweaks #329
Conversation
5202a3f
to
f348678
Compare
* Given a pkgPath, remove the `pkg:/` portion of the path. | ||
*/ | ||
public removePkgProtocol(pkgPath: string) { | ||
if (pkgPath.startsWith('pkg:/')) { |
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.
Maybe add libpkg:
?
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.
Handled in 50a1555
pkgPath = pkgPath.replace(/\\/g, '/'); | ||
return 'pkg:/' + pkgPath; | ||
if (!pkgPath.startsWith('pkg:/')) { |
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.
Maybe add libpkg:
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.
Handled in 50a1555
if (targetPath === 'pkg:') { | ||
public getPkgPathFromTarget(sourcePkgPath: string, targetPath: string) { | ||
//handle some edge cases | ||
if (targetPath === 'pkg:' || targetPath === 'pkg:/') { |
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.
Maybe add libpkg:
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.
Handled in 50a1555
Closing in favor of #399 |
Here are some internal changes that I've been wanting to make for a while. These are breaking changes, but I'd rather get them in now before more projects start to depend on brighterscript and would have a more wide-reaching impact.
Notable changes:
pathAbsolute
tosrcPath
for brevity and claritypkgPath
strings now contain an actual pkg path (i.e."source/main.brs"
is now"pkg:/source/main.brs"
)pkgPath
originally stored the platform-specific path separator (\
on windows,/
on everything else). NowpkgPath
always stores the unix separator because that's what is used on the roku device.program
file functions to auto-detect the path type and use the correct file collection (this.files
orthis.pkgMap
) accordingly.program.files
andprogram.pkgMap
now store their keys in all lower case, which removes the need to iterate the collection to find filesnormalizePath: boolean
parameter toprogram.getFile
to support skippingutil.standardizePath
when the caller knows the path has already been normalized