Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkloubert committed Jan 10, 2018
1 parent 80b0910 commit 82c52b9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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&quote=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&quote=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)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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).",
Expand Down
32 changes: 26 additions & 6 deletions src/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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(<PackageGitSettings>gitSettings) || <any>{};

if (deploy_helpers.isNullOrUndefined(FILE_FILTER.files)) {
(<any>FILE_FILTER).files = pkg.files;
}

if (deploy_helpers.isNullOrUndefined(FILE_FILTER.exclude)) {
(<any>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;
}
Expand Down

0 comments on commit 82c52b9

Please sign in to comment.