From 59bc5d427e78bf8826dd07cd40d15b8ca52ae2b2 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 26 Jul 2016 14:52:14 +0200 Subject: [PATCH] Copy static/, dot-atom/ and vendor/ as they are --- build/build.js | 2 ++ build/lib/copy-static-assets.js | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 build/lib/copy-static-assets.js diff --git a/build/build.js b/build/build.js index 39ca7bc41..0688033e6 100644 --- a/build/build.js +++ b/build/build.js @@ -5,7 +5,9 @@ const cleanOutputDirectory = require('./lib/clean-output-directory') const transpileBabelPaths = require('./lib/transpile-babel-paths') const transpileCoffeeScriptPaths = require('./lib/transpile-coffee-script-paths') +const copyStaticAssets = require('./lib/copy-static-assets') cleanOutputDirectory() transpileBabelPaths() transpileCoffeeScriptPaths() +copyStaticAssets() diff --git a/build/lib/copy-static-assets.js b/build/lib/copy-static-assets.js new file mode 100644 index 000000000..b5ef54983 --- /dev/null +++ b/build/lib/copy-static-assets.js @@ -0,0 +1,22 @@ +// This module exports a function that copies all the static assets into the +// appropriate location in the build output directory. + +'use strict' + +const path = require('path') +const fs = require('fs-extra') +const computeDestinationPath = require('./compute-destination-path') +const CONFIG = require('../config') + +module.exports = function () { + console.log('Copying static assets...'); + const sourcePaths = [ + path.join(CONFIG.repositoryRootPath, 'static'), + path.join(CONFIG.repositoryRootPath, 'dot-atom'), + path.join(CONFIG.repositoryRootPath, 'vendor') + ] + + for (let srcPath of sourcePaths) { + fs.copySync(srcPath, computeDestinationPath(srcPath)) + } +}