From 6cc66a0b2010f8395819826d027995861a34642c Mon Sep 17 00:00:00 2001 From: Paris Kasidiaris Date: Mon, 5 Dec 2016 13:17:13 +0200 Subject: [PATCH 1/3] Bring back the `build` directory for temporary builds Fix #375 --- .gitignore | 2 +- bin/build | 27 ++++++++++++++++----------- demo/app.js | 2 +- demo/index.html | 12 ++++++------ 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index efa028b6..47a3aa85 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ docs/ npm-debug.log /.idea/ .env -dist/* +build/ diff --git a/bin/build b/bin/build index 36a6cf25..126392ab 100755 --- a/bin/build +++ b/bin/build @@ -1,26 +1,31 @@ #! /usr/bin/env bash +set -e + +# $BUILD_DIR should default to "build" +export BUILD_DIR=${BUILD_DIR:=build} + # Clean out/* to prevent confusion if files were deleted in src/ rm -rf out/* # Build all TypeScript files (including tests) to out/ tsc -# Concat all xterm.js files into a single file and output as a UMD to dist/xterm.js -browserify ./out/xterm.js --standalone Terminal --debug --outfile ./dist/xterm.js -cat ./dist/xterm.js | exorcist ./dist/xterm.js.map -b ./dist > ./dist/xterm.temp.js -rm ./dist/xterm.js -mv ./dist/xterm.temp.js ./dist/xterm.js +# Concat all xterm.js files into a single file and output as a UMD to $BUILD_DIR/xterm.js +browserify ./out/xterm.js --standalone Terminal --debug --outfile ./$BUILD_DIR/xterm.js +cat ./$BUILD_DIR/xterm.js | exorcist ./$BUILD_DIR/xterm.js.map -b ./$BUILD_DIR > ./$BUILD_DIR/xterm.temp.js +rm ./$BUILD_DIR/xterm.js +mv ./$BUILD_DIR/xterm.temp.js ./$BUILD_DIR/xterm.js -# Resolve the chain of sourcemaps so that ./dist/xterm.js.map points at ./src -sorcery -i dist/xterm.js +# Resolve the chain of sourcemaps so that ./$BUILD_DIR/xterm.js.map points at ./src +sorcery -i $BUILD_DIR/xterm.js -# Copy all CSS files from src/ to dist/ +# Copy all CSS files from src/ to $BUILD_DIR/ cd src -find . -name '*.css' | cpio -pdm ../dist +find . -name '*.css' | cpio -pdm ../$BUILD_DIR cd .. -# Copy addons from out/ to dist/ +# Copy addons from out/ to $BUILD_DIR/ cd out/addons -find . -name '*.js' | cpio -pdm ../../dist/addons +find . -name '*.js' | cpio -pdm ../../$BUILD_DIR/addons cd ../.. diff --git a/demo/app.js b/demo/app.js index bdedc3be..a4122ace 100644 --- a/demo/app.js +++ b/demo/app.js @@ -7,7 +7,7 @@ var pty = require('pty.js'); var terminals = {}, logs = {}; -app.use('/dist', express.static(__dirname + '/../dist')); +app.use('/build', express.static(__dirname + '/../build')); app.get('/', function(req, res){ res.sendFile(__dirname + '/index.html'); diff --git a/demo/index.html b/demo/index.html index 5391735d..285fe002 100644 --- a/demo/index.html +++ b/demo/index.html @@ -2,14 +2,14 @@ xterm.js demo - - + + - - - - + + + +

xterm.js: xterm, in the browser

From 243d76617b88a9bdf43ceb15ac14ec56b4c3e974 Mon Sep 17 00:00:00 2001 From: Paris Kasidiaris Date: Mon, 5 Dec 2016 13:34:10 +0200 Subject: [PATCH 2/3] Create the build directory if it does not exist already --- bin/build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/build b/bin/build index 126392ab..123bbd51 100755 --- a/bin/build +++ b/bin/build @@ -5,6 +5,10 @@ set -e # $BUILD_DIR should default to "build" export BUILD_DIR=${BUILD_DIR:=build} +# Create the build directory +mkdir -p $BUILD_DIR + + # Clean out/* to prevent confusion if files were deleted in src/ rm -rf out/* From 70ec2496db151df21f704889163b0bdf692a566d Mon Sep 17 00:00:00 2001 From: Paris Kasidiaris Date: Mon, 5 Dec 2016 21:29:50 +0200 Subject: [PATCH 3/3] Remove `export` from build script --- bin/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build b/bin/build index 123bbd51..2def2c2b 100755 --- a/bin/build +++ b/bin/build @@ -3,7 +3,7 @@ set -e # $BUILD_DIR should default to "build" -export BUILD_DIR=${BUILD_DIR:=build} +BUILD_DIR=${BUILD_DIR:=build} # Create the build directory mkdir -p $BUILD_DIR