mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
38
build/lib/watch/index.js
Normal file
38
build/lib/watch/index.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const es = require('event-stream');
|
||||
|
||||
/** Ugly hack for gulp-tsb */
|
||||
function handleDeletions() {
|
||||
return es.mapSync(f => {
|
||||
if (/\.ts$/.test(f.relative) && !f.contents) {
|
||||
f.contents = new Buffer('');
|
||||
f.stat = { mtime: new Date() };
|
||||
}
|
||||
|
||||
return f;
|
||||
});
|
||||
}
|
||||
|
||||
let watch = void 0;
|
||||
|
||||
if (!process.env['VSCODE_USE_LEGACY_WATCH']) {
|
||||
try {
|
||||
watch = require('./watch-nsfw');
|
||||
} catch (err) {
|
||||
console.warn('Could not load our cross platform file watcher: ' + err.toString());
|
||||
console.warn('Falling back to our platform specific watcher...');
|
||||
}
|
||||
}
|
||||
|
||||
if (!watch) {
|
||||
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
return watch.apply(null, arguments)
|
||||
.pipe(handleDeletions());
|
||||
};
|
||||
Reference in New Issue
Block a user