Skip to content

Commit

Permalink
Merge pull request #5 from jeroenouw/gitlab
Browse files Browse the repository at this point in the history
Gitlab
  • Loading branch information
jeroenouw authored Jun 7, 2019
2 parents 544f629 + 6b8cd13 commit d9532f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cgx",
"version": "1.2.0",
"version": "1.2.2",
"description": "Generate all the recommended files (pre-filled) for the Github and Gitlab community standards",
"author": "Jeroen Ouwehand",
"repository": "https://github.com/jeroenouw/cgx",
Expand Down Expand Up @@ -30,6 +30,7 @@
},
"dependencies": {
"@types/fs-extra": "^5.0.5",
"commander": "^2.20.0",
"figlet": "^1.2.1",
"fs-extra": "^8.0.0",
"inquirer": "^6.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/models/choice.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface Answer {
files: Object;
confirm: boolean;
githubName: string;
userName: string;
licenses: LicenseValue;
provider: ProviderValue;
}
Expand Down
18 changes: 9 additions & 9 deletions src/options/universal/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export class License {

switch(licenseAnswer.licenses) {
case LicenseValue.APACHE: {
fileContent = this.APACHEfileContent(githubNameAnswer.githubName);
fileContent = this.APACHEfileContent(githubNameAnswer.userName);
return this.createFile(filepath, fileContent, fileName);
}
case LicenseValue.MIT: {
fileContent = this.MITfileContent(githubNameAnswer.githubName);
fileContent = this.MITfileContent(githubNameAnswer.userName);
return this.createFile(filepath, fileContent, fileName);
}
case LicenseValue.ISC: {
fileContent = this.ISCfileContent(githubNameAnswer.githubName);
fileContent = this.ISCfileContent(githubNameAnswer.userName);
return this.createFile(filepath, fileContent, fileName);
}
}
Expand All @@ -54,10 +54,10 @@ export class License {
});
}

private MITfileContent(githubName: string): string {
private MITfileContent(userName: string): string {
return `MIT License
Copyright (c) ${this.currentYear} ${githubName}
Copyright (c) ${this.currentYear} ${userName}
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -79,8 +79,8 @@ SOFTWARE.
`;
}

private ISCfileContent(githubName: string): string {
return `Copyright (c) ${this.currentYear} ${githubName}
private ISCfileContent(userName: string): string {
return `Copyright (c) ${this.currentYear} ${userName}
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted,
provided that the above copyright notice and this permission notice appear in all copies.
Expand All @@ -90,7 +90,7 @@ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CON
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.`
}

private APACHEfileContent(githubName: string): string {
private APACHEfileContent(userName: string): string {
return `Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -279,7 +279,7 @@ file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright ${this.currentYear} ${githubName}
Copyright ${this.currentYear} ${userName}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

0 comments on commit d9532f6

Please sign in to comment.