mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Task/check file length (#9047)
* add filelength task to vscodeTasks * added to package task instead of build * testing for failures with reduced limits * reverted to actual lengths
This commit is contained in:
@@ -275,6 +275,9 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
}
|
||||
|
||||
let result = all
|
||||
.pipe(fileLengthFilter)
|
||||
.pipe(filelength)
|
||||
.pipe(fileLengthFilter.restore)
|
||||
.pipe(util.skipDirectories())
|
||||
.pipe(util.fixWin32DirectoryPermissions())
|
||||
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
|
||||
@@ -329,6 +332,29 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
};
|
||||
}
|
||||
|
||||
const fileLengthFilter = filter([
|
||||
'**',
|
||||
'!extensions/import/*.docx',
|
||||
'!extensions/admin-tool-ext-win/license/**'
|
||||
], {restore: true});
|
||||
|
||||
const filelength = es.through(function (file) {
|
||||
|
||||
const fileName = path.basename(file.relative);
|
||||
const fileDir = path.dirname(file.relative);
|
||||
//check the filename is < 50 characters (basename gets the filename with extension).
|
||||
if (fileName.length > 50) {
|
||||
console.error(`File name '${fileName}' under ${fileDir} is too long. Rename file to have less than 50 characters.`);
|
||||
throw new Error('File name exceeds acceptable length of 50 characters: ' + fileName);
|
||||
}
|
||||
if (file.relative.length > 150) {
|
||||
console.error(`File path ${file.relative} exceeds acceptable file-length. Rename the path to have less than 150 characters.`);
|
||||
throw new Error('File path exceeds acceptable path-length of 150 characters: ' + file.relative);
|
||||
}
|
||||
|
||||
this.emit('data', file);
|
||||
});
|
||||
|
||||
const buildRoot = path.dirname(root);
|
||||
|
||||
const BUILD_TARGETS = [
|
||||
|
||||
Reference in New Issue
Block a user