@uniformdev/cli 20.55.2-alpha.2 → 20.55.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +16 -12
  2. package/package.json +9 -9
package/dist/index.mjs CHANGED
@@ -324,8 +324,8 @@ async function readJSON(path8) {
324
324
  }
325
325
  async function tryReadJSON(path8, missingValue = null) {
326
326
  try {
327
- const stat = await fs.stat(path8);
328
- return stat.isFile() ? await readJSON(path8) : missingValue;
327
+ const stat2 = await fs.stat(path8);
328
+ return stat2.isFile() ? await readJSON(path8) : missingValue;
329
329
  } catch {
330
330
  return missingValue;
331
331
  }
@@ -1107,7 +1107,7 @@ import { PostHog } from "posthog-node";
1107
1107
  // package.json
1108
1108
  var package_default = {
1109
1109
  name: "@uniformdev/cli",
1110
- version: "20.55.1",
1110
+ version: "20.55.2",
1111
1111
  description: "Uniform command line interface tool",
1112
1112
  license: "SEE LICENSE IN LICENSE.txt",
1113
1113
  main: "./cli.js",
@@ -11340,8 +11340,7 @@ var PolicyDocumentsPullModule = {
11340
11340
  };
11341
11341
 
11342
11342
  // src/commands/policy-documents/commands/push.ts
11343
- import { existsSync as existsSync5, mkdirSync as mkdirSync4 } from "fs";
11344
- import { readdir as readdir2 } from "fs/promises";
11343
+ import { readdir as readdir2, stat } from "fs/promises";
11345
11344
  import { extname as extname2, join as join11 } from "path";
11346
11345
  async function readLocalPolicyDocuments(directory, format, verbose) {
11347
11346
  const files = await readdir2(directory);
@@ -11458,11 +11457,16 @@ var PolicyDocumentsPushModule = {
11458
11457
  allowEmptySource,
11459
11458
  verbose
11460
11459
  }) => {
11461
- if (!existsSync5(directory)) {
11462
- if (verbose) {
11463
- console.log(`Creating directory ${directory}`);
11460
+ try {
11461
+ const dirStat = await stat(directory);
11462
+ if (!dirStat.isDirectory()) {
11463
+ throw new Error(`Path "${directory}" is not a directory`);
11464
+ }
11465
+ } catch (e) {
11466
+ if (e.code === "ENOENT") {
11467
+ throw new Error(`Directory "${directory}" does not exist`);
11464
11468
  }
11465
- mkdirSync4(directory, { recursive: true });
11469
+ throw e;
11466
11470
  }
11467
11471
  const fetch2 = nodeFetchProxy(proxy, verbose);
11468
11472
  const localDocs = await readLocalPolicyDocuments(directory, format, verbose);
@@ -13282,7 +13286,7 @@ var WebhookCommand = {
13282
13286
  import { bold as bold3, gray as gray6, green as green7 } from "colorette";
13283
13287
 
13284
13288
  // src/updateCheck.ts
13285
- import { existsSync as existsSync6, promises as fs8 } from "fs";
13289
+ import { existsSync as existsSync5, promises as fs8 } from "fs";
13286
13290
  import { get as getHttp } from "http";
13287
13291
  import { get as getHttps } from "https";
13288
13292
  import { tmpdir } from "os";
@@ -13294,7 +13298,7 @@ var encode = (value) => encodeURIComponent(value).replace(/^%40/, "@");
13294
13298
  var getFile = async (details, distTag) => {
13295
13299
  const rootDir = tmpdir();
13296
13300
  const subDir = join12(rootDir, "update-check");
13297
- if (!existsSync6(subDir)) {
13301
+ if (!existsSync5(subDir)) {
13298
13302
  await fs8.mkdir(subDir);
13299
13303
  }
13300
13304
  let name = `${details.name}-${distTag}.json`;
@@ -13304,7 +13308,7 @@ var getFile = async (details, distTag) => {
13304
13308
  return join12(subDir, name);
13305
13309
  };
13306
13310
  var evaluateCache = async (file, time, interval) => {
13307
- if (existsSync6(file)) {
13311
+ if (existsSync5(file)) {
13308
13312
  const content = await fs8.readFile(file, "utf8");
13309
13313
  const { lastUpdate, latest } = JSON.parse(content);
13310
13314
  const nextCheck = lastUpdate + interval;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "20.55.2-alpha.2+62d2ec9b3f",
3
+ "version": "20.55.2",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -28,13 +28,13 @@
28
28
  "dependencies": {
29
29
  "@inquirer/prompts": "^7.10.1",
30
30
  "@thi.ng/mime": "^2.2.23",
31
- "@uniformdev/assets": "20.55.2-alpha.2+62d2ec9b3f",
32
- "@uniformdev/canvas": "20.55.2-alpha.2+62d2ec9b3f",
33
- "@uniformdev/context": "20.55.2-alpha.2+62d2ec9b3f",
34
- "@uniformdev/files": "20.55.2-alpha.2+62d2ec9b3f",
35
- "@uniformdev/project-map": "20.55.2-alpha.2+62d2ec9b3f",
36
- "@uniformdev/redirect": "20.55.2-alpha.2+62d2ec9b3f",
37
- "@uniformdev/richtext": "20.55.2-alpha.2+62d2ec9b3f",
31
+ "@uniformdev/assets": "20.55.2",
32
+ "@uniformdev/canvas": "20.55.2",
33
+ "@uniformdev/context": "20.55.2",
34
+ "@uniformdev/files": "20.55.2",
35
+ "@uniformdev/project-map": "20.55.2",
36
+ "@uniformdev/redirect": "20.55.2",
37
+ "@uniformdev/richtext": "20.55.2",
38
38
  "call-bind": "^1.0.2",
39
39
  "colorette": "2.0.20",
40
40
  "cosmiconfig": "9.0.0",
@@ -81,5 +81,5 @@
81
81
  "publishConfig": {
82
82
  "access": "public"
83
83
  },
84
- "gitHead": "62d2ec9b3f273a02798cb93040a1edf4dee0c9c2"
84
+ "gitHead": "89324ab1962ec6d849b47d2823f214098cc68a28"
85
85
  }