File tree Expand file tree Collapse file tree 2 files changed +9
-4442
lines changed Expand file tree Collapse file tree 2 files changed +9
-4442
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ var wd = process.cwd();
107
107
108
108
var sampleDir = __dirname + '/../sample' ;
109
109
var destDir = path . normalize ( wd + '/' + arg1 ) ;
110
+ var clientFileSourcePath = path . normalize ( destDir + '/node_modules/socketcluster-client/socketcluster.js' ) ;
111
+ var clientFileDestPath = path . normalize ( destDir + '/public/socketcluster.js' ) ;
110
112
111
113
var createFail = function ( ) {
112
114
errorMessage ( "Failed to create SocketCluster sample app." ) ;
@@ -126,7 +128,13 @@ var createSuccess = function () {
126
128
errorMessage ( "Failed to install dependencies for sample '" + arg1 + "' app. Navigate to " +
127
129
destDir + " and then try to run 'npm install' from there." ) ;
128
130
} else {
129
- successMessage ( "SocketCluster sample '" + destDir + "' was setup successfully." ) ;
131
+ try {
132
+ fs . writeFileSync ( clientFileDestPath , fs . readFileSync ( clientFileSourcePath ) ) ;
133
+ successMessage ( "SocketCluster sample '" + destDir + "' was setup successfully." ) ;
134
+ } catch ( err ) {
135
+ warningMessage ( "Failed to copy file from '" + clientFileSourcePath + "' to '" +
136
+ clientFileDestPath + "' - Try copying it manually." ) ;
137
+ }
130
138
}
131
139
process . exit ( ) ;
132
140
} ) ;
You can’t perform that action at this time.
0 commit comments