mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix symlinking extensions into .k8slens/extensions folder (#1579)
* fix symlinking extensions into .k8slens/extensions folder Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
63ead8e65a
commit
99c3a00721
@ -113,8 +113,8 @@ export class ExtensionDiscovery {
|
|||||||
|
|
||||||
// chokidar works better than fs.watch
|
// chokidar works better than fs.watch
|
||||||
chokidar.watch(this.localFolderPath, {
|
chokidar.watch(this.localFolderPath, {
|
||||||
// Dont watch recursively into subdirectories
|
// For adding and removing symlinks to work, the depth has to be 1.
|
||||||
depth: 0,
|
depth: 1,
|
||||||
// Try to wait until the file has been completely copied.
|
// Try to wait until the file has been completely copied.
|
||||||
// The OS might emit an event for added file even it's not completely written to the filesysten.
|
// The OS might emit an event for added file even it's not completely written to the filesysten.
|
||||||
awaitWriteFinish: {
|
awaitWriteFinish: {
|
||||||
@ -123,7 +123,7 @@ export class ExtensionDiscovery {
|
|||||||
stabilityThreshold: 300
|
stabilityThreshold: 300
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// Extension add is detected by watching "<extensionDir>package.json" add
|
// Extension add is detected by watching "<extensionDir>/package.json" add
|
||||||
.on("add", this.handleWatchFileAdd)
|
.on("add", this.handleWatchFileAdd)
|
||||||
// Extension remove is detected by watching <extensionDir>" unlink
|
// Extension remove is detected by watching <extensionDir>" unlink
|
||||||
.on("unlinkDir", this.handleWatchUnlinkDir);
|
.on("unlinkDir", this.handleWatchUnlinkDir);
|
||||||
@ -189,7 +189,7 @@ export class ExtensionDiscovery {
|
|||||||
*/
|
*/
|
||||||
async uninstallExtension(absolutePath: string) {
|
async uninstallExtension(absolutePath: string) {
|
||||||
logger.info(`${logModule} Uninstalling ${absolutePath}`);
|
logger.info(`${logModule} Uninstalling ${absolutePath}`);
|
||||||
|
|
||||||
const exists = await fs.pathExists(absolutePath);
|
const exists = await fs.pathExists(absolutePath);
|
||||||
|
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
|
|||||||
@ -386,8 +386,11 @@ export class Extensions extends React.Component {
|
|||||||
<div className="no-extensions flex box gaps justify-center">
|
<div className="no-extensions flex box gaps justify-center">
|
||||||
<Icon material="info"/>
|
<Icon material="info"/>
|
||||||
<div>
|
<div>
|
||||||
{search && <p>No search results found</p>}
|
{
|
||||||
{!search && <p>There are no installed extensions. See list of <a href="https://github.com/lensapp/lens-extensions/blob/main/README.md" target="_blank" rel="noreferrer">available extensions</a>.</p>}
|
search
|
||||||
|
? <p>No search results found</p>
|
||||||
|
: <p>There are no installed extensions. See list of <a href="https://github.com/lensapp/lens-extensions/blob/main/README.md" target="_blank" rel="noreferrer">available extensions</a>.</p>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user