1
0
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:
Sebastian Malton 2020-12-01 09:53:44 -05:00 committed by GitHub
parent 63ead8e65a
commit 99c3a00721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -113,8 +113,8 @@ export class ExtensionDiscovery {
// chokidar works better than fs.watch
chokidar.watch(this.localFolderPath, {
// Dont watch recursively into subdirectories
depth: 0,
// For adding and removing symlinks to work, the depth has to be 1.
depth: 1,
// 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.
awaitWriteFinish: {
@ -123,7 +123,7 @@ export class ExtensionDiscovery {
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)
// Extension remove is detected by watching <extensionDir>" unlink
.on("unlinkDir", this.handleWatchUnlinkDir);
@ -189,7 +189,7 @@ export class ExtensionDiscovery {
*/
async uninstallExtension(absolutePath: string) {
logger.info(`${logModule} Uninstalling ${absolutePath}`);
const exists = await fs.pathExists(absolutePath);
if (!exists) {

View File

@ -386,8 +386,11 @@ export class Extensions extends React.Component {
<div className="no-extensions flex box gaps justify-center">
<Icon material="info"/>
<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>
);