From 82c52b97bc8d9fb399d0cd49c6d0772a4eb2a02c Mon Sep 17 00:00:00 2001 From: Marcel Kloubert Date: Wed, 10 Jan 2018 17:59:37 +0100 Subject: [PATCH] bugfixes --- CHANGELOG.md | 3 ++- package-lock.json | 2 +- package.json | 21 ++++++++++++++++++++- src/packages.ts | 32 ++++++++++++++++++++++++++------ 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb8593..a3493f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,9 @@ [![Share via Facebook](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Facebook.png)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded"e=vscode-deploy-reloaded) [![Share via Twitter](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Twitter.png)](https://twitter.com/intent/tweet?source=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&text=vscode-deploy-reloaded:%20https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&via=mjkloubert) [![Share via Google+](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Google+.png)](https://plus.google.com/share?url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded) [![Share via Pinterest](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Pinterest.png)](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&media=https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/demo1.gif&description=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20%27vs-deploy%27%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.) [![Share via Reddit](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Reddit.png)](https://www.reddit.com/submit?url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&title=vscode-deploy-reloaded) [![Share via LinkedIn](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/LinkedIn.png)](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded&title=vscode-deploy-reloaded&summary=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20%27vs-deploy%27%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.&source=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded) [![Share via Wordpress](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Wordpress.png)](https://wordpress.com/press-this.php?u=https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded"e=vscode-deploy-reloaded&s=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20%27vs-deploy%27%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.&i=https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/demo1.gif) [![Share via Email](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/share/Email.png)](mailto:?subject=vscode-deploy-reloaded&body=Recoded%20version%20of%20Visual%20Studio%20Code%20extension%20'vs-deploy'%2C%20which%20provides%20commands%20to%20deploy%20files%20to%20one%20or%20more%20destinations.:%20https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dmkloubert.vscode-deploy-reloaded) -## 0.28.0 (January 10th, 2018; import git files to packages) +## 0.28.1 (January 10th, 2018; import git files to packages) +* bugfixes * can [import files from git](https://github.com/mkloubert/vscode-deploy-reloaded/wiki/import_git_files_to_packages) into a [package](https://github.com/mkloubert/vscode-deploy-reloaded/wiki#packages-) now ![Demo Import git files into package](https://raw.githubusercontent.com/mkloubert/vscode-deploy-reloaded/master/img/demo15.gif) diff --git a/package-lock.json b/package-lock.json index b2642c6..56bbc83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vscode-deploy-reloaded", - "version": "0.28.0", + "version": "0.28.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index dccc540..c836dc1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-deploy-reloaded", "displayName": "Deploy (Reloaded)", "description": "Deploys files of a workspace to a destination.", - "version": "0.28.0", + "version": "0.28.1", "publisher": "mkloubert", "engines": { "vscode": "^1.19.0" @@ -648,11 +648,30 @@ "description": "The custom branch to use.", "default": "master" }, + "exclude": { + "description": "A custom list of one or more (glob) patterns of files for git files to EXCLUDE. If not defined, the (exclude) pattern list from the package is used.", + "type": "array", + "items": { + "type": "string" + } + }, + "files": { + "description": "A custom list of one or more (glob) patterns of files for git files to INCLUDE. If not defined, the (include) pattern list from the package is used.", + "type": "array", + "items": { + "type": "string" + } + }, "from": { "type": "string", "description": "The hash from where to start (youngest).", "pattern": "([a-f|A-F|0-9]{7})([a-f|A-F|0-9]{33})?" }, + "gitFilesOnly": { + "description": "Use only the file list from git or not.", + "type": "boolean", + "default": true + }, "to": { "type": "string", "description": "The hash where to stop (oldest).", diff --git a/src/packages.ts b/src/packages.ts index 7f004db..5a78370 100644 --- a/src/packages.ts +++ b/src/packages.ts @@ -129,19 +129,23 @@ export type PackageFileListResolverResult = string | string[]; /** * git settings for a package. */ -export interface PackageGitSettings { +export interface PackageGitSettings extends deploy_contracts.FileFilter { /** * The custom branch. */ - branch?: string; + readonly branch?: string; /** * The first (youngest) commit. */ - from?: string; + readonly from?: string; + /** + * Only use files from git or not. + */ + readonly gitFilesOnly?: boolean; /** * The first (oldest) commit. */ - to?: string; + readonly to?: string; } /** @@ -558,6 +562,12 @@ export async function importPackageFilesFromGit(pkg: Package, operation: deploy_ }; } + if (deploy_helpers.toBooleanSafe(gitSettings.gitFilesOnly, true)) { + while (files.length > 0) { + files.pop(); + } + } + const WORKSPACE = pkg.__workspace; const NORMALIZED_INPUT_FILES = deploy_helpers.asArray(files).map(f => { @@ -763,12 +773,22 @@ export async function importPackageFilesFromGit(pkg: Package, operation: deploy_ return false; } - let filePatterns = TO_MINIMATCH_PATTERNS(pkg.files); + const FILE_FILTER: deploy_contracts.FileFilter = deploy_helpers.cloneObject(gitSettings) || {}; + + if (deploy_helpers.isNullOrUndefined(FILE_FILTER.files)) { + (FILE_FILTER).files = pkg.files; + } + + if (deploy_helpers.isNullOrUndefined(FILE_FILTER.exclude)) { + (FILE_FILTER).exclude = pkg.exclude; + } + + let filePatterns = TO_MINIMATCH_PATTERNS(FILE_FILTER.files); if (filePatterns.length < 1) { filePatterns = [ '/**' ]; } - let exludePatterns = TO_MINIMATCH_PATTERNS(pkg.exclude); + let exludePatterns = TO_MINIMATCH_PATTERNS(FILE_FILTER.exclude); if (exludePatterns.length < 1) { exludePatterns = undefined; }