Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/yarn.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function Get-ScriptDirectory {
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any difference between the output of this function and $PSScriptRoot?

Copy link
Member

@Gudahtt Gudahtt Aug 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$PSScriptRoot may not have been considered because it was introduced in PowerShell 3. It would not work for users of older versions of PowerShell.

Edit: Sorry, forgot to answer your question. No, I don't believe there is any difference.

Copy link
Contributor Author

@mikemaccana mikemaccana Aug 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the author $PSScriptRoot wasn't considered because I just learnt about it from @felixfbecker. 😀 Do we want to support Windows 7 default (Powershell 2) or not though?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $PSScriptRoot was introduced in PS 3 that would mean it is not supported in Windows 7 - I don't know what the support policy is here from yarn / NodeJS?


node "$(Get-ScriptDirectory)/yarn.js" $args