From 70ae35926ce62bb69b8474f39bfe9a50265caa45 Mon Sep 17 00:00:00 2001 From: "Fernando G. Vilar" Date: Thu, 10 Oct 2019 11:00:19 +0700 Subject: [PATCH 1/2] feature(licencse): current year for license --- LICENSE | 2 +- tools/init.ts | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index cd1a9bed..e43d796c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2017 --username-- <--usermail--> +Copyright --year-- --username-- <--usermail--> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/tools/init.ts b/tools/init.ts index a8f683af..7bdab102 100644 --- a/tools/init.ts +++ b/tools/init.ts @@ -131,7 +131,7 @@ function libraryNameSuggestedAccept() { /** * The library name is suggested by looking at the directory name of the * tools parent directory and converting it to kebab-case - * + * * The regex for this looks for any non-word or non-digit character, or * an underscore (as it's a word character), and replaces it with a dash. * Any leading or trailing dashes are then removed, before the string is @@ -160,7 +160,7 @@ function libraryNameSuggestedIsDefault() { /** * Calls all of the functions needed to setup the library - * + * * @param libraryName */ function setupLibrary(libraryName: string) { @@ -176,7 +176,7 @@ function setupLibrary(libraryName: string) { removeItems() - modifyContents(libraryName, username, usermail) + modifyContents(libraryName, new Date().getUTCFullYear().toString(), username, usermail) renameItems(libraryName) @@ -202,20 +202,20 @@ function removeItems() { /** * Updates the contents of the template files with the library name or user details - * - * @param libraryName - * @param username - * @param usermail + * + * @param libraryName + * @param username + * @param usermail */ -function modifyContents(libraryName: string, username: string, usermail: string) { +function modifyContents(libraryName: string, year: string, username: string, usermail: string) { console.log(colors.underline.white("Modified")) let files = modifyFiles.map(f => path.resolve(__dirname, "..", f)) try { const changes = replace.sync({ files, - from: [/--libraryname--/g, /--username--/g, /--usermail--/g], - to: [libraryName, username, usermail] + from: [/--libraryname--/g, /--year--/g, /--username--/g, /--usermail--/g], + to: [libraryName, year, username, usermail] }) console.log(colors.yellow(modifyFiles.join("\n"))) } catch (error) { @@ -227,8 +227,8 @@ function modifyContents(libraryName: string, username: string, usermail: string) /** * Renames any template files to the new library name - * - * @param libraryName + * + * @param libraryName */ function renameItems(libraryName: string) { console.log(colors.underline.white("Renamed")) From fb550246380478212e46ec6d6b4038e7a96140a2 Mon Sep 17 00:00:00 2001 From: "Fernando G. Vilar" Date: Thu, 10 Oct 2019 12:13:29 +0700 Subject: [PATCH 2/2] feature(license): current year for license --- LICENSE | 2 +- tools/init.ts | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index cd1a9bed..e43d796c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2017 --username-- <--usermail--> +Copyright --year-- --username-- <--usermail--> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/tools/init.ts b/tools/init.ts index a8f683af..7bdab102 100644 --- a/tools/init.ts +++ b/tools/init.ts @@ -131,7 +131,7 @@ function libraryNameSuggestedAccept() { /** * The library name is suggested by looking at the directory name of the * tools parent directory and converting it to kebab-case - * + * * The regex for this looks for any non-word or non-digit character, or * an underscore (as it's a word character), and replaces it with a dash. * Any leading or trailing dashes are then removed, before the string is @@ -160,7 +160,7 @@ function libraryNameSuggestedIsDefault() { /** * Calls all of the functions needed to setup the library - * + * * @param libraryName */ function setupLibrary(libraryName: string) { @@ -176,7 +176,7 @@ function setupLibrary(libraryName: string) { removeItems() - modifyContents(libraryName, username, usermail) + modifyContents(libraryName, new Date().getUTCFullYear().toString(), username, usermail) renameItems(libraryName) @@ -202,20 +202,20 @@ function removeItems() { /** * Updates the contents of the template files with the library name or user details - * - * @param libraryName - * @param username - * @param usermail + * + * @param libraryName + * @param username + * @param usermail */ -function modifyContents(libraryName: string, username: string, usermail: string) { +function modifyContents(libraryName: string, year: string, username: string, usermail: string) { console.log(colors.underline.white("Modified")) let files = modifyFiles.map(f => path.resolve(__dirname, "..", f)) try { const changes = replace.sync({ files, - from: [/--libraryname--/g, /--username--/g, /--usermail--/g], - to: [libraryName, username, usermail] + from: [/--libraryname--/g, /--year--/g, /--username--/g, /--usermail--/g], + to: [libraryName, year, username, usermail] }) console.log(colors.yellow(modifyFiles.join("\n"))) } catch (error) { @@ -227,8 +227,8 @@ function modifyContents(libraryName: string, username: string, usermail: string) /** * Renames any template files to the new library name - * - * @param libraryName + * + * @param libraryName */ function renameItems(libraryName: string) { console.log(colors.underline.white("Renamed"))