mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Fix rendering of boolean values in CRDs - add optional special casing for boolean values in DrawerItems and TableRows since React (imo annoying fashion) does not render boolean values by default. - add a spinner on the sidebar for when the CRD menu is expeanded but the entries have not been loaded yet. - Add ability to double click a Badge to expand, also make it so that Badges highligh all text on first click. Signed-off-by: Sebastian Malton <sebastian@malton.name>
13 lines
555 B
TypeScript
13 lines
555 B
TypeScript
// Save file to electron app directory (e.g. "/Users/$USER/Library/Application Support/Lens" for MacOS)
|
|
import path from "path";
|
|
import { app, remote } from "electron";
|
|
import { ensureDirSync, writeFileSync } from "fs-extra";
|
|
import { WriteFileOptions } from "fs"
|
|
|
|
export function saveToAppFiles(filePath: string, contents: any, options?: WriteFileOptions): string {
|
|
const absPath = path.resolve((app || remote.app).getPath("userData"), filePath);
|
|
ensureDirSync(path.dirname(absPath));
|
|
writeFileSync(absPath, contents, options);
|
|
return absPath;
|
|
}
|