Skip to content

Commit

Permalink
Release v1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Sep 23, 2023
1 parent fec418a commit 6b1d333
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ See the **TypeScript Declarations** at the top of [copy-file.ts](copy-file.ts) f
<br>

---
**CLI Build Tools**
**CLI Build Tools for package.json**
- 🎋 [add-dist-header](https://github.com/center-key/add-dist-header):&nbsp; _Prepend a one-line banner comment (with license notice) to distribution files_
- 📄 [copy-file-util](https://github.com/center-key/copy-file-util):&nbsp; _Copy or rename a file with optional package version number_
- 📂 [copy-folder-util](https://github.com/center-key/copy-folder-util):&nbsp; _Recursively copy files from one folder to another folder_
Expand Down
7 changes: 4 additions & 3 deletions dist/copy-file.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! copy-file-util v1.1.1 ~~ https://github.com/center-key/copy-file-util ~~ MIT License
//! copy-file-util v1.1.2 ~~ https://github.com/center-key/copy-file-util ~~ MIT License

export type Options = {
export type Settings = {
cd: string;
targetFile: string;
targetFolder: string;
Expand All @@ -14,6 +14,7 @@ export type Result = {
moved: boolean;
};
declare const copyFile: {
cp(sourceFile: string, options: Partial<Options>): Result;
cp(sourceFile: string, options?: Partial<Settings>): Result;
reporter(result: Result): Result;
};
export { copyFile };
13 changes: 12 additions & 1 deletion dist/copy-file.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! copy-file-util v1.1.1 ~~ https://github.com/center-key/copy-file-util ~~ MIT License
//! copy-file-util v1.1.2 ~~ https://github.com/center-key/copy-file-util ~~ MIT License

import chalk from 'chalk';
import fs from 'fs';
import log from 'fancy-log';
import path from 'path';
import slash from 'slash';
const copyFile = {
Expand Down Expand Up @@ -50,5 +52,14 @@ const copyFile = {
duration: Date.now() - startTime,
};
},
reporter(result) {
const name = chalk.gray('copy-file');
const origin = chalk.blue.bold(result.origin);
const dest = chalk.magenta(result.dest);
const arrow = chalk.gray.bold('→');
const info = chalk.white(`(${result.duration}ms${result.moved ? ', move' : ''})`);
log(name, origin, arrow, dest, info);
return result;
},
};
export { copyFile };
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "copy-file-util",
"version": "1.1.1",
"version": "1.1.2",
"description": "Copy or rename a file with optional package version number (CLI tool designed for use in npm scripts)",
"license": "MIT",
"type": "module",
Expand All @@ -20,7 +20,10 @@
"copy-file": "bin/cli.js",
"copy-file-util": "bin/cli.js"
},
"repository": "github:center-key/copy-file-util",
"repository": {
"type": "git",
"url": "git+https://github.com/center-key/copy-file-util.git"
},
"homepage": "https://github.com/center-key/copy-file-util",
"bugs": "https://github.com/center-key/copy-file-util/issues",
"docs": "https://github.com/center-key/copy-file-util#readme",
Expand Down Expand Up @@ -88,12 +91,12 @@
},
"devDependencies": {
"@types/fancy-log": "~2.0",
"@types/node": "~20.5",
"@typescript-eslint/eslint-plugin": "~6.6",
"@typescript-eslint/parser": "~6.6",
"@types/node": "~20.6",
"@typescript-eslint/eslint-plugin": "~6.7",
"@typescript-eslint/parser": "~6.7",
"add-dist-header": "~1.3",
"assert-deep-strict-equal": "~1.1",
"eslint": "~8.48",
"eslint": "~8.50",
"jshint": "~2.13",
"mocha": "~10.2",
"rimraf": "~5.0",
Expand Down
7 changes: 4 additions & 3 deletions task-runner.sh.command
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ setupTools() {

releaseInstructions() {
cd $projectHome
repository=$(grep repository package.json | awk -F'"' '{print $4}' | sed s/github://)
package=https://raw.githubusercontent.com/$repository/main/package.json
org=$(grep git+https package.json | awk -F'/' '{print $4}')
name=$(grep '"name":' package.json | awk -F'"' '{print $4}')
package=https://raw.githubusercontent.com/$org/$name/main/package.json
version=v$(grep '"version"' package.json | awk -F'"' '{print $4}')
pushed=v$(curl --silent $package | grep '"version":' | awk -F'"' '{print $4}')
minorVersion=$(echo ${pushed:1} | awk -F"." '{ print $1 "." $2 }')
released=$(git tag | tail -1)
published=v$(npm view $repository version)
published=v$(npm view $name version)
test $? -ne 0 && echo "NOTE: Ignore error if package is not yet published."
echo "Local changes:"
git status --short
Expand Down

0 comments on commit 6b1d333

Please sign in to comment.