mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Move drop files instead of copying (#9936)
* Move files instead of copying * Just grab folders * Preserve directories * mkdir * recursive * Specify extensions
This commit is contained in:
@@ -6,24 +6,33 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as vfs from 'vinyl-fs';
|
import * as vfs from 'vinyl-fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as es from 'event-stream';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
|
||||||
const files = [
|
const files = [
|
||||||
'.build/extensions/**/*.vsix', // external extensions
|
'.build/extensions/**/*.vsix', // external extensions
|
||||||
'.build/win32-x64/**/*.{exe,zip}', // windows binaries
|
'.build/win32-x64/**/*.{exe,zip}', // windows binaries
|
||||||
'.build/linux/sha256hashes.txt', // linux hashes
|
'.build/linux/sha256hashes.txt', // linux hashes
|
||||||
'.build/linux/deb/amd64/deb/*', // linux debs
|
'.build/linux/deb/amd64/deb/*.deb', // linux debs
|
||||||
'.build/linux/rpm/x86_64/*', // linux rpms
|
'.build/linux/rpm/x86_64/*.rpm', // linux rpms
|
||||||
'.build/linux/server/*', // linux server
|
'.build/linux/server/*', // linux server
|
||||||
'.build/linux/archive/*', // linux archive
|
'.build/linux/archive/*', // linux archive
|
||||||
'.build/docker/**', // docker images
|
'.build/docker/*', // docker images
|
||||||
'.build/darwin/**', // darwin binaries
|
'.build/darwin/*', // darwin binaries
|
||||||
'.build/version.json' // version information
|
'.build/version.json' // version information
|
||||||
];
|
];
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const stream = vfs.src(files, { base: '.build', allowEmpty: true })
|
const stream = vfs.src(files, { base: '.build', allowEmpty: true })
|
||||||
.pipe(vfs.dest(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY!));
|
.pipe(es.through(file => {
|
||||||
|
const filePath = path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY!,
|
||||||
|
//Preserve intermediate directories after .build folder
|
||||||
|
file.path.substr(path.resolve('.build').length + 1));
|
||||||
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
||||||
|
fs.renameSync(file.path, filePath);
|
||||||
|
}));
|
||||||
|
|
||||||
stream.on('end', () => resolve());
|
stream.on('end', () => resolve());
|
||||||
stream.on('error', e => reject(e));
|
stream.on('error', e => reject(e));
|
||||||
|
|||||||
Reference in New Issue
Block a user