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 authored and GitHub committed 2020-12-01 09:53:44 -05:00
1 parent 63ead8e65a
commit 99c3a00721
2 files changed
+8 -5

No files matched your search

+3 -3
View File
@@ -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);
@@ -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>
); );