Skip to content
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

Fix the path.sep replacement of node-haste for Windows #11641

Closed
wants to merge 1 commit into from

Conversation

jhen0409
Copy link
Contributor

@jhen0409 jhen0409 commented Dec 27, 2016

Fix the path.sep replacement for Windows, currently it just replace one segment:

// Result: './lib/random\random-byte.js'
'./lib\\random\\random-byte.js'.replace(path.sep, '/') 

Change to regex will work fine:

// Result: './lib/random/random-byte.js' (correct)
'./lib\\random\\random-byte.js'.replace(new RegExp('\\' + path.sep, 'g'), '/') 

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @davidaurelio and @jeanlauliac to be potential reviewers.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 27, 2016
@jhen0409 jhen0409 changed the title Fix node-haste's Package.redirectRequire for Windows Fix the path.sep replacement of node-haste for Windows Dec 27, 2016
@ide
Copy link
Contributor

ide commented Dec 27, 2016

@facebook-github-bot shipit

@facebook-github-bot
Copy link
Contributor

@ide has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

nicktate pushed a commit to nicktate/react-native that referenced this pull request Dec 30, 2016
Summary:
Fix the `path.sep` replacement for Windows, currently it just replace one segment:

```js
// Result: './lib/random\random-byte.js'
'./lib\\random\\random-byte.js'.replace(path.sep, '/')
```

Change to regex will work fine:

```js
// Result: './lib/random/random-byte.js' (correct)
'./lib\\random\\random-byte.js'.replace(new RegExp('\\' + path.sep, 'g'), '/')
```
Closes facebook#11641

Differential Revision: D4368402

fbshipit-source-id: 46f456359d1cd2ca790881773e8a76af8616cd21
DanielMSchmidt pushed a commit to DanielMSchmidt/react-native that referenced this pull request Jan 4, 2017
Summary:
Fix the `path.sep` replacement for Windows, currently it just replace one segment:

```js
// Result: './lib/random\random-byte.js'
'./lib\\random\\random-byte.js'.replace(path.sep, '/')
```

Change to regex will work fine:

```js
// Result: './lib/random/random-byte.js' (correct)
'./lib\\random\\random-byte.js'.replace(new RegExp('\\' + path.sep, 'g'), '/')
```
Closes facebook#11641

Differential Revision: D4368402

fbshipit-source-id: 46f456359d1cd2ca790881773e8a76af8616cd21
cpojer pushed a commit to facebook/metro that referenced this pull request Jan 26, 2017
Summary:
Fix the `path.sep` replacement for Windows, currently it just replace one segment:

```js
// Result: './lib/random\random-byte.js'
'./lib\\random\\random-byte.js'.replace(path.sep, '/')
```

Change to regex will work fine:

```js
// Result: './lib/random/random-byte.js' (correct)
'./lib\\random\\random-byte.js'.replace(new RegExp('\\' + path.sep, 'g'), '/')
```
Closes facebook/react-native#11641

Differential Revision: D4368402

fbshipit-source-id: 46f456359d1cd2ca790881773e8a76af8616cd21
@jhen0409 jhen0409 deleted the patch-5 branch February 8, 2017 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants