Permalink
Browse files

Build: Make release script create CDN directory if missing

```
$ node build/release.js 3.0.1
Current version is 3.0.1-pre; generating release 3.0.1
(...)
Copying dist/jquery-migrate.js to CDN/jquery-migrate-3.0.1.js
Error: ENOENT: no such file or directory, open 'CDN/jquery-migrate-3.0.1.js'
    at Object.fs.openSync (fs.js:652:18)
```

Closes #271.
  • Loading branch information...
Krinkle committed Nov 28, 2017
1 parent d388224 commit 496bd8738785e6c88248487302dee7dd00607619
Showing with 7 additions and 3 deletions.
  1. +7 −3 build/release.js
View
@@ -32,9 +32,10 @@ var releaseVersion,
devFile = "dist/jquery-migrate.js",
minFile = "dist/jquery-migrate.min.js",
releaseDir = "CDN/",
releaseFiles = {
"CDN/jquery-migrate-VER.js": devFile,
"CDN/jquery-migrate-VER.min.js": minFile
"jquery-migrate-VER.js": devFile,
"jquery-migrate-VER.min.js": minFile
};
steps(
@@ -162,8 +163,11 @@ function gruntBuild( next ) {
function makeReleaseCopies( next ) {
finalFiles = {};
if ( !fs.existsSync( releaseDir ) ) {
fs.mkdirSync( releaseDir );
}
Object.keys( releaseFiles ).forEach( function( key ) {
var builtFile = releaseFiles[ key ],
var builtFile = releaseDir + releaseFiles[ key ],
releaseFile = key.replace( /VER/g, releaseVersion );
copy( builtFile, releaseFile );

0 comments on commit 496bd87

Please sign in to comment.