Browse Source

npm installes every package into a dir now

master
Daniel Hübleitner 2 years ago
parent
commit
26db25035a
2 changed files with 7 additions and 7 deletions
  1. 5
    4
      src/backend/Extension.ts
  2. 2
    3
      src/backend/UpdateManger.ts

+ 5
- 4
src/backend/Extension.ts View File

@@ -76,7 +76,7 @@ abstract class Extension<Status extends SharedStatus>{
76 76
 }
77 77
 
78 78
 export type FSStatus = SharedStatus & {
79
-    prefix: string 
79
+    path: string 
80 80
     empty?: boolean
81 81
 }
82 82
 
@@ -144,13 +144,14 @@ type NPMStatus = FSStatus & {
144 144
 }
145 145
 
146 146
 export class NPMExtension extends FSExtension<NPMStatus>{
147
-
147
+    private prefix: string
148 148
     constructor(
149 149
         pkgName: string,
150
+        prefix: string = './plugins',
150 151
         private version: string,
151
-        private prefix: string
152 152
     ){
153
-        super(pkgName, path.resolve(prefix, "node_modules"))
153
+        super(pkgName, path.resolve(prefix, pkgName, "node_modules"))
154
+        this.prefix = (path.resolve(prefix, pkgName))
154 155
     }
155 156
 
156 157
     public async status(): Promise<NPMStatus> {

+ 2
- 3
src/backend/UpdateManger.ts View File

@@ -87,9 +87,8 @@ export class UpdateManager extends Plugin{
87 87
 */      
88 88
 
89 89
         const extensions = [
90
-            new NPMExtension("knex", "0.19.2", "./plugins"),
91
-            new NPMExtension("sqlite3", "4.1.0", "./plugins"),
92
-            new NPMExtension("frontblock", "latest", "./plugins")
90
+            new NPMExtension("knex", "./plugins", "0.19.2",).install(),
91
+            new NPMExtension("sqlite3", "./plugins", "4.1.0").install()
93 92
         ]
94 93
 
95 94
 

Loading…
Cancel
Save