-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make the find function in movesocket more flexible
- Loading branch information
Showing
3 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Copyright (c) 2016, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or | ||
* https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
|
||
/** | ||
* ./scripts/moveSocket.js | ||
* | ||
* Call this script from the command line to move the socket.io.js from | ||
* any folder in socket.io-client to the destination folder. | ||
*/ | ||
|
||
require('shelljs/global'); | ||
const DEST_PATH = 'public'; | ||
|
||
const arr = find('node_modules/socket.io-client') | ||
.filter((file) => { | ||
return file.match(/socket.io.js$/); | ||
}); | ||
if (arr.length !== 1) { | ||
throw new Error('Did not find client-side socket.io script'); | ||
} else { | ||
cp('-f', arr[0], DEST_PATH); | ||
} |