@utopia-utils/cli
Advanced tools
Comparing version 0.3.24 to 0.3.25
@@ -1,3 +0,3 @@ | ||
import o from"path";var a=o.resolve(process.cwd(),"node_modules/.cache");import{execSync as e}from"child_process";function f(){try{let t=e("git rev-parse --short HEAD").toString().replace(` | ||
`,"").trim();if(t==="undefined")throw new Error("Could not retrieve git commit hash.");return t}catch(t){console.error("Could not retrieve git commit hash.")}}function h(){return process.env.npm_package_version}import s from"fs/promises";async function l(t){try{return(await s.stat(t)).isDirectory()}catch(r){return!1}}import n from"fs/promises";async function v(t){try{return(await n.stat(t)).isFile()}catch(r){return!1}}import{access as i}from"fs/promises";async function D(t){try{return await i(t),!0}catch(r){return!1}}export{a as CACHE_DIR,f as getGitCommitHash,h as getHostProjectPkgVersion,l as isDirector,v as isFile,D as pathExists}; | ||
import o from"path";var c=o.resolve(process.cwd(),"node_modules/.cache");import{execSync as e}from"child_process";function f(){try{let t=e("git rev-parse --short HEAD").toString().replace(` | ||
`,"").trim();if(t==="undefined")throw new Error("Could not retrieve git commit hash.");return t}catch(t){console.error("Could not retrieve git commit hash.")}}function h(){return process.env.npm_package_version}import s from"fs/promises";async function x(t){try{return(await s.stat(t)).isDirectory()}catch(r){return!1}}import n from"fs/promises";async function v(t){try{return(await n.stat(t)).isFile()}catch(r){return!1}}import{access as i}from"fs/promises";async function P(t){try{return await i(t),!0}catch(r){return!1}}export{c as CACHE_DIR,f as getGitCommitHash,h as getHostProjectPkgVersion,x as isDirector,v as isFile,P as pathExists}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@utopia-utils/cli", | ||
"type": "module", | ||
"version": "0.3.24", | ||
"version": "0.3.25", | ||
"description": "Collection of common cli utils", | ||
@@ -25,4 +25,4 @@ "author": "Utopia <https://github.com/GreatAuk>", | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.js" | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
} | ||
@@ -40,4 +40,5 @@ }, | ||
"test": "vitest", | ||
"typecheck": "tsc --noEmit" | ||
"typecheck": "tsc --noEmit", | ||
"clean": "rm -rf .turbo & rm -rf node_modules & rm -rf dist" | ||
} | ||
} |
@@ -7,3 +7,3 @@ import { execSync } from 'node:child_process' | ||
*/ | ||
export function getGitCommitHash() { | ||
export function getGitCommitHash(): string | undefined { | ||
try { | ||
@@ -10,0 +10,0 @@ const hash = execSync('git rev-parse --short HEAD').toString().replace('\n', '').trim() |
@@ -5,4 +5,4 @@ /** | ||
*/ | ||
export function getHostProjectPkgVersion() { | ||
export function getHostProjectPkgVersion(): string { | ||
return process.env.npm_package_version as string | ||
} |
import fs from 'node:fs/promises' | ||
export async function isDirector(path: string) { | ||
export async function isDirector(path: string): Promise<boolean> { | ||
try { | ||
@@ -5,0 +5,0 @@ const stat = await fs.stat(path) |
@@ -8,3 +8,3 @@ import fs from 'node:fs/promises' | ||
*/ | ||
export async function isFile(path: string) { | ||
export async function isFile(path: string): Promise<boolean> { | ||
try { | ||
@@ -11,0 +11,0 @@ const stat = await fs.stat(path) |
@@ -8,3 +8,3 @@ import { access } from 'node:fs/promises' | ||
*/ | ||
export async function pathExists(path: string) { | ||
export async function pathExists(path: string): Promise<boolean> { | ||
try { | ||
@@ -11,0 +11,0 @@ await access(path) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16005
18