|
| 1 | +/** |
| 2 | + * © 2020, db-developer. |
| 3 | + * Licensed under the MIT license. |
| 4 | + */ |
| 5 | +const path = require( "path" ); |
| 6 | + |
| 7 | +const LATEST = "latest"; |
| 8 | +const TGZ = "tgz" |
| 9 | + |
| 10 | +module.exports = function ( grunt, options ) { |
| 11 | + const VERSION = options.package.version; |
| 12 | + const PACKAGE = options.package.name.replace( "@", "" ).replace( "/", "-" ); |
| 13 | + const PKGSDIR = path.join( "..", "..", "_packages_" ); |
| 14 | + |
| 15 | + return { |
| 16 | + build: { |
| 17 | + files: [ |
| 18 | + { |
| 19 | + src: [ "*.md", "!CODEFOCONDUCT.md", "!package.json", "LICENSE" ], |
| 20 | + dest: `${ options.BUILDDIR }/` |
| 21 | + },{ |
| 22 | + expand: true, |
| 23 | + cwd: `${ options.DOCSDIR }/`, |
| 24 | + src: [ "**/*.md" ], |
| 25 | + dest: `${ options.BUILDDIR }/${ options.DOCSDIR }/` |
| 26 | + },{ |
| 27 | + expand: true, |
| 28 | + flatten: true, |
| 29 | + filter: "isFile", |
| 30 | + src: [ `${ options.TASKSDIR }/*.js` ], |
| 31 | + dest: `${ options.BUILDDIR }/tasks/` |
| 32 | + } |
| 33 | + ] |
| 34 | + }, |
| 35 | + deploy: { |
| 36 | + files: [ |
| 37 | + { |
| 38 | + src: `${ options.DISTDIR }/${ PACKAGE }-${ VERSION }.${ TGZ }`, |
| 39 | + dest: `${ PKGSDIR }/${ PACKAGE }-${ VERSION }.${ TGZ }` |
| 40 | + }, { |
| 41 | + src: `${ options.DISTDIR }/${ PACKAGE }-${ VERSION }.${ TGZ }`, |
| 42 | + dest: `${ PKGSDIR }/${ PACKAGE }-${ LATEST }.${ TGZ }` |
| 43 | + } |
| 44 | + ] |
| 45 | + }, |
| 46 | + test: { |
| 47 | + expand: true, |
| 48 | + cwd: `${ options.TEMPLATEDIR }/`, |
| 49 | + src: `*`, |
| 50 | + dest: `${ options.TMPDIR }/` |
| 51 | + } |
| 52 | + } |
| 53 | +}; |
0 commit comments