@h3ravel/filesystem 0.3.1 → 0.4.1

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.
package/dist/index.cjs CHANGED
@@ -35,9 +35,12 @@ var StorageLinkCommand = class extends __h3ravel_core.ConsoleCommand {
35
35
  *
36
36
  * @var string
37
37
  */
38
- signature = `storage:link
39
- {--r|relative : Create the symbolic link using relative paths}
40
- {--force : Recreate existing symbolic links}
38
+ signature = `#storage:
39
+ {link : Create the symbolic links configured for the application.
40
+ | {--r|relative : Create the symbolic link using relative paths}
41
+ | {--force : Recreate existing symbolic links}
42
+ }
43
+ {unlink : Delete existing symbolic links configured for the application.}
41
44
  `;
42
45
  /**
43
46
  * The console command description.
@@ -50,6 +53,13 @@ var StorageLinkCommand = class extends __h3ravel_core.ConsoleCommand {
50
53
  */
51
54
  async handle() {
52
55
  console.log("");
56
+ const command = this.dictionary.baseCommand ?? this.dictionary.name;
57
+ await this[command]();
58
+ }
59
+ /**
60
+ * Create the symbolic links configured for the application.
61
+ */
62
+ async link() {
53
63
  const links = config("filesystem.links");
54
64
  for (const key in links) {
55
65
  const force = this.option("force");
@@ -63,13 +73,14 @@ var StorageLinkCommand = class extends __h3ravel_core.ConsoleCommand {
63
73
  ["link already exists.\n", "white"]
64
74
  ], " ");
65
75
  continue;
66
- } else if (force) {
67
- await (0, fs_promises.rm)(newPath, {
68
- recursive: true,
69
- force: true
70
- });
71
- await (0, fs_promises.symlink)(existingPath, newPath);
72
- } else await (0, fs_promises.symlink)(existingPath, newPath);
76
+ } else if (force) await (0, fs_promises.rm)(newPath, {
77
+ recursive: true,
78
+ force: true
79
+ });
80
+ /**
81
+ * Create the symlink
82
+ */
83
+ await (0, fs_promises.symlink)(existingPath, newPath);
73
84
  __h3ravel_shared.Logger.log([
74
85
  [" INFO ", "bgBlue"],
75
86
  [" The ", "white"],
@@ -80,6 +91,25 @@ var StorageLinkCommand = class extends __h3ravel_core.ConsoleCommand {
80
91
  ], "");
81
92
  }
82
93
  }
94
+ /**
95
+ * Delete existing symbolic links configured for the application.
96
+ */
97
+ async unlink() {
98
+ const links = config("filesystem.links");
99
+ for (const path in links) if (await __h3ravel_shared.FileSystem.fileExists(path)) {
100
+ /**
101
+ * Remove the symlink
102
+ */
103
+ await (0, fs_promises.unlink)(path);
104
+ __h3ravel_shared.Logger.log([
105
+ [" INFO ", "bgBlue"],
106
+ [" The ", "white"],
107
+ [`[${path.replace(process.cwd(), "")}] `, "bold"],
108
+ ["link has been deleted", "white"],
109
+ [".\n", "white"]
110
+ ], "");
111
+ }
112
+ }
83
113
  };
84
114
 
85
115
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["ConsoleCommand","FileSystem","ServiceProvider"],"sources":["../src/Commands/StorageLinkCommand.ts","../src/Providers/FilesystemProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { rm, symlink } from 'fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\n\nexport class StorageLinkCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `storage:link\n {--r|relative : Create the symbolic link using relative paths}\n {--force : Recreate existing symbolic links}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Create the symbolic links configured for the application.'\n\n /**\n * Execute the console command.\n */\n public async handle () {\n console.log('')\n const links = config('filesystem.links')\n\n for (const key in links) {\n const force = this.option('force')\n const newPath = key\n const existingPath = links[key]\n\n if (!force && await FileSystem.fileExists(newPath)) {\n Logger.log([\n [' ERROR ', 'bgRed'],\n ['The', 'white'],\n [`[${newPath.replace(process.cwd(), '')}]`, 'bold'],\n ['link already exists.\\n', 'white']\n ], ' ')\n continue\n } else if (force) {\n await rm(newPath, { recursive: true, force: true })\n await symlink(existingPath, newPath)\n } else {\n await symlink(existingPath, newPath)\n }\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${newPath.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been connected to ', 'white'],\n [`[${existingPath.replace(process.cwd(), '')}]`, 'bold'],\n ['.\\n', 'white']\n ], '')\n }\n }\n}\n","import { ServiceProvider } from '@h3ravel/core'\nimport { StorageLinkCommand } from '../Commands/StorageLinkCommand'\n\n/**\n * Sets up Filesystem management and lifecycle.\n * \n */\nexport class FilesystemProvider extends ServiceProvider {\n public static priority = 997\n\n register () {\n this.commands([StorageLinkCommand])\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAa,qBAAb,cAAwCA,8BAAe;;;;;;CAOnD,AAAU,YAAoB;;;;;;;;;CAS9B,AAAU,cAAsB;;;;CAKhC,MAAa,SAAU;AACnB,UAAQ,IAAI,GAAG;EACf,MAAM,QAAQ,OAAO,mBAAmB;AAExC,OAAK,MAAM,OAAO,OAAO;GACrB,MAAM,QAAQ,KAAK,OAAO,QAAQ;GAClC,MAAM,UAAU;GAChB,MAAM,eAAe,MAAM;AAE3B,OAAI,CAAC,SAAS,MAAMC,4BAAW,WAAW,QAAQ,EAAE;AAChD,4BAAO,IAAI;KACP,CAAC,WAAW,QAAQ;KACpB,CAAC,OAAO,QAAQ;KAChB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;KACnD,CAAC,0BAA0B,QAAQ;KACtC,EAAE,IAAI;AACP;cACO,OAAO;AACd,8BAAS,SAAS;KAAE,WAAW;KAAM,OAAO;KAAM,CAAC;AACnD,mCAAc,cAAc,QAAQ;SAEpC,gCAAc,cAAc,QAAQ;AAGxC,2BAAO,IAAI;IACP,CAAC,UAAU,SAAS;IACpB,CAAC,SAAS,QAAQ;IAClB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,OAAO;IACpD,CAAC,+BAA+B,QAAQ;IACxC,CAAC,IAAI,aAAa,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;IACxD,CAAC,OAAO,QAAQ;IACnB,EAAE,GAAG;;;;;;;;;;;AClDlB,IAAa,qBAAb,cAAwCC,+BAAgB;CACpD,OAAc,WAAW;CAEzB,WAAY;AACR,OAAK,SAAS,CAAC,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.cjs","names":["ConsoleCommand","FileSystem","ServiceProvider"],"sources":["../src/Commands/StorageLinkCommand.ts","../src/Providers/FilesystemProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { rm, symlink, unlink } from 'fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\n\nexport class StorageLinkCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#storage:\n {link : Create the symbolic links configured for the application. \n | {--r|relative : Create the symbolic link using relative paths}\n | {--force : Recreate existing symbolic links}\n }\n {unlink : Delete existing symbolic links configured for the application.}\n `\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Create the symbolic links configured for the application.'\n\n /**\n * Execute the console command.\n */\n public async handle (this: any) {\n console.log('')\n const command = (this.dictionary.baseCommand ?? this.dictionary.name)\n\n await this[command]()\n }\n\n /**\n * Create the symbolic links configured for the application.\n */\n public async link () {\n const links = config('filesystem.links')\n\n for (const key in links) {\n const force = this.option('force')\n const newPath = key\n const existingPath = links[key]\n\n if (!force && await FileSystem.fileExists(newPath)) {\n Logger.log([\n [' ERROR ', 'bgRed'],\n ['The', 'white'],\n [`[${newPath.replace(process.cwd(), '')}]`, 'bold'],\n ['link already exists.\\n', 'white']\n ], ' ')\n continue\n } else if (force) {\n await rm(newPath, { recursive: true, force: true })\n }\n\n /**\n * Create the symlink\n */\n await symlink(existingPath, newPath)\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${newPath.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been connected to ', 'white'],\n [`[${existingPath.replace(process.cwd(), '')}]`, 'bold'],\n ['.\\n', 'white']\n ], '')\n }\n }\n\n /**\n * Delete existing symbolic links configured for the application.\n */\n public async unlink () {\n const links = config('filesystem.links')\n\n for (const path in links) {\n if (await FileSystem.fileExists(path)) {\n /**\n * Remove the symlink\n */\n await unlink(path)\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${path.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been deleted', 'white'],\n ['.\\n', 'white']\n ], '')\n\n }\n }\n }\n}\n","import { ServiceProvider } from '@h3ravel/core'\nimport { StorageLinkCommand } from '../Commands/StorageLinkCommand'\n\n/**\n * Sets up Filesystem management and lifecycle.\n * \n */\nexport class FilesystemProvider extends ServiceProvider {\n public static priority = 997\n\n register () {\n this.commands([StorageLinkCommand])\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAa,qBAAb,cAAwCA,8BAAe;;;;;;CAOnD,AAAU,YAAoB;;;;;;;;;;;;CAa9B,AAAU,cAAsB;;;;CAKhC,MAAa,SAAmB;AAC5B,UAAQ,IAAI,GAAG;EACf,MAAM,UAAW,KAAK,WAAW,eAAe,KAAK,WAAW;AAEhE,QAAM,KAAK,UAAU;;;;;CAMzB,MAAa,OAAQ;EACjB,MAAM,QAAQ,OAAO,mBAAmB;AAExC,OAAK,MAAM,OAAO,OAAO;GACrB,MAAM,QAAQ,KAAK,OAAO,QAAQ;GAClC,MAAM,UAAU;GAChB,MAAM,eAAe,MAAM;AAE3B,OAAI,CAAC,SAAS,MAAMC,4BAAW,WAAW,QAAQ,EAAE;AAChD,4BAAO,IAAI;KACP,CAAC,WAAW,QAAQ;KACpB,CAAC,OAAO,QAAQ;KAChB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;KACnD,CAAC,0BAA0B,QAAQ;KACtC,EAAE,IAAI;AACP;cACO,MACP,2BAAS,SAAS;IAAE,WAAW;IAAM,OAAO;IAAM,CAAC;;;;AAMvD,kCAAc,cAAc,QAAQ;AAEpC,2BAAO,IAAI;IACP,CAAC,UAAU,SAAS;IACpB,CAAC,SAAS,QAAQ;IAClB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,OAAO;IACpD,CAAC,+BAA+B,QAAQ;IACxC,CAAC,IAAI,aAAa,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;IACxD,CAAC,OAAO,QAAQ;IACnB,EAAE,GAAG;;;;;;CAOd,MAAa,SAAU;EACnB,MAAM,QAAQ,OAAO,mBAAmB;AAExC,OAAK,MAAM,QAAQ,MACf,KAAI,MAAMA,4BAAW,WAAW,KAAK,EAAE;;;;AAInC,iCAAa,KAAK;AAElB,2BAAO,IAAI;IACP,CAAC,UAAU,SAAS;IACpB,CAAC,SAAS,QAAQ;IAClB,CAAC,IAAI,KAAK,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,OAAO;IACjD,CAAC,yBAAyB,QAAQ;IAClC,CAAC,OAAO,QAAQ;IACnB,EAAE,GAAG;;;;;;;;;;;ACxFtB,IAAa,qBAAb,cAAwCC,+BAAgB;CACpD,OAAc,WAAW;CAEzB,WAAY;AACR,OAAK,SAAS,CAAC,mBAAmB,CAAC"}
package/dist/index.d.cts CHANGED
@@ -18,7 +18,15 @@ declare class StorageLinkCommand extends ConsoleCommand {
18
18
  /**
19
19
  * Execute the console command.
20
20
  */
21
- handle(): Promise<void>;
21
+ handle(this: any): Promise<void>;
22
+ /**
23
+ * Create the symbolic links configured for the application.
24
+ */
25
+ link(): Promise<void>;
26
+ /**
27
+ * Delete existing symbolic links configured for the application.
28
+ */
29
+ unlink(): Promise<void>;
22
30
  }
23
31
  //#endregion
24
32
  //#region src/Providers/FilesystemProvider.d.ts
package/dist/index.d.ts CHANGED
@@ -18,7 +18,15 @@ declare class StorageLinkCommand extends ConsoleCommand {
18
18
  /**
19
19
  * Execute the console command.
20
20
  */
21
- handle(): Promise<void>;
21
+ handle(this: any): Promise<void>;
22
+ /**
23
+ * Create the symbolic links configured for the application.
24
+ */
25
+ link(): Promise<void>;
26
+ /**
27
+ * Delete existing symbolic links configured for the application.
28
+ */
29
+ unlink(): Promise<void>;
22
30
  }
23
31
  //#endregion
24
32
  //#region src/Providers/FilesystemProvider.d.ts
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FileSystem, Logger } from "@h3ravel/shared";
2
- import { rm, symlink } from "fs/promises";
2
+ import { rm, symlink, unlink } from "fs/promises";
3
3
  import { ConsoleCommand, ServiceProvider } from "@h3ravel/core";
4
4
 
5
5
  //#region src/Commands/StorageLinkCommand.ts
@@ -9,9 +9,12 @@ var StorageLinkCommand = class extends ConsoleCommand {
9
9
  *
10
10
  * @var string
11
11
  */
12
- signature = `storage:link
13
- {--r|relative : Create the symbolic link using relative paths}
14
- {--force : Recreate existing symbolic links}
12
+ signature = `#storage:
13
+ {link : Create the symbolic links configured for the application.
14
+ | {--r|relative : Create the symbolic link using relative paths}
15
+ | {--force : Recreate existing symbolic links}
16
+ }
17
+ {unlink : Delete existing symbolic links configured for the application.}
15
18
  `;
16
19
  /**
17
20
  * The console command description.
@@ -24,6 +27,13 @@ var StorageLinkCommand = class extends ConsoleCommand {
24
27
  */
25
28
  async handle() {
26
29
  console.log("");
30
+ const command = this.dictionary.baseCommand ?? this.dictionary.name;
31
+ await this[command]();
32
+ }
33
+ /**
34
+ * Create the symbolic links configured for the application.
35
+ */
36
+ async link() {
27
37
  const links = config("filesystem.links");
28
38
  for (const key in links) {
29
39
  const force = this.option("force");
@@ -37,13 +47,14 @@ var StorageLinkCommand = class extends ConsoleCommand {
37
47
  ["link already exists.\n", "white"]
38
48
  ], " ");
39
49
  continue;
40
- } else if (force) {
41
- await rm(newPath, {
42
- recursive: true,
43
- force: true
44
- });
45
- await symlink(existingPath, newPath);
46
- } else await symlink(existingPath, newPath);
50
+ } else if (force) await rm(newPath, {
51
+ recursive: true,
52
+ force: true
53
+ });
54
+ /**
55
+ * Create the symlink
56
+ */
57
+ await symlink(existingPath, newPath);
47
58
  Logger.log([
48
59
  [" INFO ", "bgBlue"],
49
60
  [" The ", "white"],
@@ -54,6 +65,25 @@ var StorageLinkCommand = class extends ConsoleCommand {
54
65
  ], "");
55
66
  }
56
67
  }
68
+ /**
69
+ * Delete existing symbolic links configured for the application.
70
+ */
71
+ async unlink() {
72
+ const links = config("filesystem.links");
73
+ for (const path in links) if (await FileSystem.fileExists(path)) {
74
+ /**
75
+ * Remove the symlink
76
+ */
77
+ await unlink(path);
78
+ Logger.log([
79
+ [" INFO ", "bgBlue"],
80
+ [" The ", "white"],
81
+ [`[${path.replace(process.cwd(), "")}] `, "bold"],
82
+ ["link has been deleted", "white"],
83
+ [".\n", "white"]
84
+ ], "");
85
+ }
86
+ }
57
87
  };
58
88
 
59
89
  //#endregion
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/Commands/StorageLinkCommand.ts","../src/Providers/FilesystemProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { rm, symlink } from 'fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\n\nexport class StorageLinkCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `storage:link\n {--r|relative : Create the symbolic link using relative paths}\n {--force : Recreate existing symbolic links}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Create the symbolic links configured for the application.'\n\n /**\n * Execute the console command.\n */\n public async handle () {\n console.log('')\n const links = config('filesystem.links')\n\n for (const key in links) {\n const force = this.option('force')\n const newPath = key\n const existingPath = links[key]\n\n if (!force && await FileSystem.fileExists(newPath)) {\n Logger.log([\n [' ERROR ', 'bgRed'],\n ['The', 'white'],\n [`[${newPath.replace(process.cwd(), '')}]`, 'bold'],\n ['link already exists.\\n', 'white']\n ], ' ')\n continue\n } else if (force) {\n await rm(newPath, { recursive: true, force: true })\n await symlink(existingPath, newPath)\n } else {\n await symlink(existingPath, newPath)\n }\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${newPath.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been connected to ', 'white'],\n [`[${existingPath.replace(process.cwd(), '')}]`, 'bold'],\n ['.\\n', 'white']\n ], '')\n }\n }\n}\n","import { ServiceProvider } from '@h3ravel/core'\nimport { StorageLinkCommand } from '../Commands/StorageLinkCommand'\n\n/**\n * Sets up Filesystem management and lifecycle.\n * \n */\nexport class FilesystemProvider extends ServiceProvider {\n public static priority = 997\n\n register () {\n this.commands([StorageLinkCommand])\n }\n}\n"],"mappings":";;;;;AAKA,IAAa,qBAAb,cAAwC,eAAe;;;;;;CAOnD,AAAU,YAAoB;;;;;;;;;CAS9B,AAAU,cAAsB;;;;CAKhC,MAAa,SAAU;AACnB,UAAQ,IAAI,GAAG;EACf,MAAM,QAAQ,OAAO,mBAAmB;AAExC,OAAK,MAAM,OAAO,OAAO;GACrB,MAAM,QAAQ,KAAK,OAAO,QAAQ;GAClC,MAAM,UAAU;GAChB,MAAM,eAAe,MAAM;AAE3B,OAAI,CAAC,SAAS,MAAM,WAAW,WAAW,QAAQ,EAAE;AAChD,WAAO,IAAI;KACP,CAAC,WAAW,QAAQ;KACpB,CAAC,OAAO,QAAQ;KAChB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;KACnD,CAAC,0BAA0B,QAAQ;KACtC,EAAE,IAAI;AACP;cACO,OAAO;AACd,UAAM,GAAG,SAAS;KAAE,WAAW;KAAM,OAAO;KAAM,CAAC;AACnD,UAAM,QAAQ,cAAc,QAAQ;SAEpC,OAAM,QAAQ,cAAc,QAAQ;AAGxC,UAAO,IAAI;IACP,CAAC,UAAU,SAAS;IACpB,CAAC,SAAS,QAAQ;IAClB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,OAAO;IACpD,CAAC,+BAA+B,QAAQ;IACxC,CAAC,IAAI,aAAa,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;IACxD,CAAC,OAAO,QAAQ;IACnB,EAAE,GAAG;;;;;;;;;;;AClDlB,IAAa,qBAAb,cAAwC,gBAAgB;CACpD,OAAc,WAAW;CAEzB,WAAY;AACR,OAAK,SAAS,CAAC,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/Commands/StorageLinkCommand.ts","../src/Providers/FilesystemProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { rm, symlink, unlink } from 'fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\n\nexport class StorageLinkCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `#storage:\n {link : Create the symbolic links configured for the application. \n | {--r|relative : Create the symbolic link using relative paths}\n | {--force : Recreate existing symbolic links}\n }\n {unlink : Delete existing symbolic links configured for the application.}\n `\n\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Create the symbolic links configured for the application.'\n\n /**\n * Execute the console command.\n */\n public async handle (this: any) {\n console.log('')\n const command = (this.dictionary.baseCommand ?? this.dictionary.name)\n\n await this[command]()\n }\n\n /**\n * Create the symbolic links configured for the application.\n */\n public async link () {\n const links = config('filesystem.links')\n\n for (const key in links) {\n const force = this.option('force')\n const newPath = key\n const existingPath = links[key]\n\n if (!force && await FileSystem.fileExists(newPath)) {\n Logger.log([\n [' ERROR ', 'bgRed'],\n ['The', 'white'],\n [`[${newPath.replace(process.cwd(), '')}]`, 'bold'],\n ['link already exists.\\n', 'white']\n ], ' ')\n continue\n } else if (force) {\n await rm(newPath, { recursive: true, force: true })\n }\n\n /**\n * Create the symlink\n */\n await symlink(existingPath, newPath)\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${newPath.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been connected to ', 'white'],\n [`[${existingPath.replace(process.cwd(), '')}]`, 'bold'],\n ['.\\n', 'white']\n ], '')\n }\n }\n\n /**\n * Delete existing symbolic links configured for the application.\n */\n public async unlink () {\n const links = config('filesystem.links')\n\n for (const path in links) {\n if (await FileSystem.fileExists(path)) {\n /**\n * Remove the symlink\n */\n await unlink(path)\n\n Logger.log([\n [' INFO ', 'bgBlue'],\n [' The ', 'white'],\n [`[${path.replace(process.cwd(), '')}] `, 'bold'],\n ['link has been deleted', 'white'],\n ['.\\n', 'white']\n ], '')\n\n }\n }\n }\n}\n","import { ServiceProvider } from '@h3ravel/core'\nimport { StorageLinkCommand } from '../Commands/StorageLinkCommand'\n\n/**\n * Sets up Filesystem management and lifecycle.\n * \n */\nexport class FilesystemProvider extends ServiceProvider {\n public static priority = 997\n\n register () {\n this.commands([StorageLinkCommand])\n }\n}\n"],"mappings":";;;;;AAKA,IAAa,qBAAb,cAAwC,eAAe;;;;;;CAOnD,AAAU,YAAoB;;;;;;;;;;;;CAa9B,AAAU,cAAsB;;;;CAKhC,MAAa,SAAmB;AAC5B,UAAQ,IAAI,GAAG;EACf,MAAM,UAAW,KAAK,WAAW,eAAe,KAAK,WAAW;AAEhE,QAAM,KAAK,UAAU;;;;;CAMzB,MAAa,OAAQ;EACjB,MAAM,QAAQ,OAAO,mBAAmB;AAExC,OAAK,MAAM,OAAO,OAAO;GACrB,MAAM,QAAQ,KAAK,OAAO,QAAQ;GAClC,MAAM,UAAU;GAChB,MAAM,eAAe,MAAM;AAE3B,OAAI,CAAC,SAAS,MAAM,WAAW,WAAW,QAAQ,EAAE;AAChD,WAAO,IAAI;KACP,CAAC,WAAW,QAAQ;KACpB,CAAC,OAAO,QAAQ;KAChB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;KACnD,CAAC,0BAA0B,QAAQ;KACtC,EAAE,IAAI;AACP;cACO,MACP,OAAM,GAAG,SAAS;IAAE,WAAW;IAAM,OAAO;IAAM,CAAC;;;;AAMvD,SAAM,QAAQ,cAAc,QAAQ;AAEpC,UAAO,IAAI;IACP,CAAC,UAAU,SAAS;IACpB,CAAC,SAAS,QAAQ;IAClB,CAAC,IAAI,QAAQ,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,OAAO;IACpD,CAAC,+BAA+B,QAAQ;IACxC,CAAC,IAAI,aAAa,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,IAAI,OAAO;IACxD,CAAC,OAAO,QAAQ;IACnB,EAAE,GAAG;;;;;;CAOd,MAAa,SAAU;EACnB,MAAM,QAAQ,OAAO,mBAAmB;AAExC,OAAK,MAAM,QAAQ,MACf,KAAI,MAAM,WAAW,WAAW,KAAK,EAAE;;;;AAInC,SAAM,OAAO,KAAK;AAElB,UAAO,IAAI;IACP,CAAC,UAAU,SAAS;IACpB,CAAC,SAAS,QAAQ;IAClB,CAAC,IAAI,KAAK,QAAQ,QAAQ,KAAK,EAAE,GAAG,CAAC,KAAK,OAAO;IACjD,CAAC,yBAAyB,QAAQ;IAClC,CAAC,OAAO,QAAQ;IACnB,EAAE,GAAG;;;;;;;;;;;ACxFtB,IAAa,qBAAb,cAAwC,gBAAgB;CACpD,OAAc,WAAW;CAEzB,WAAY;AACR,OAAK,SAAS,CAAC,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h3ravel/filesystem",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "Filesystem manager for H3ravel.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -37,11 +37,11 @@
37
37
  "filesystem"
38
38
  ],
39
39
  "dependencies": {
40
- "@h3ravel/support": "^0.10.3",
41
- "@h3ravel/shared": "^0.20.8"
40
+ "@h3ravel/shared": "^0.20.11",
41
+ "@h3ravel/support": "^0.10.4"
42
42
  },
43
43
  "peerDependencies": {
44
- "@h3ravel/core": "^1.11.0"
44
+ "@h3ravel/core": "^1.11.1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "typescript": "^5.4.0"