awslabs / git-secrets

Prevents you from committing secrets and credentials into git repositories
Apache License 2.0
12.36k stars 1.17k forks source link

Fix slash on Windows #118

Open MagicJohnJang opened 5 years ago

MagicJohnJang commented 5 years ago

Issue #, if available: The slashes cause building the wrong file of .git-secrets

Description of changes: Fix forward-slash(Linux) to backslash(Windows).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

ChristopherGAndrews commented 5 years ago

Which version of PowerShell are you on? I am on:

$PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17134  590

It does not care about the slash direction, it will auto switch them. But that being said, it should be changed to the native format, the less you leave up to interpretation the better.

MagicJohnJang commented 5 years ago

Can't reduce the issue as it happened before, and it does work with both slash on my PC now.

Mine:

λ  $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      15063  1746
sparr commented 1 year ago

I cannot find documentation of when PowerShell started supporting forward slashes in paths. If backslashes extend compatibility to older versions, and don't break compatibility with current or expected future versions, we should switch.

Can someone confirm whether forward slashes worked in PS v5.0, v4, v3, earlier?