You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It may make sense to unignore the db/_edit-global-gitignore.json database file if you want to share your global gitignore between computers (that share the same .kenv).
As a JetBrains user, this script comes in very handy when needing to ignore some of the Plugin config files that are automatically created in the .idea folder:
// Name: Edit global .gitignore// Description: Opens an editor with the global .gitignore file and sets it up if it doesn't existimport"@johnlindquist/kit"import{writeFile}from"node:fs/promises"import{startSpinner}from"@josxa/kit-utils"constcache=awaitdb({defaultEntries: []asstring[]})constDESIRED_IGNORE_PATH=home(".global.gitignore")constensureGlobalGitIgnorePathConfigured=async()=>{try{constexisting=awaitexec("git config --global core.excludesfile")debuggerif(existing.stdout.toString()!==DESIRED_IGNORE_PATH){awaitexec(`git config --global core.excludesfile "${DESIRED_IGNORE_PATH}"`)awaitdiv(`Global gitconfig file configured to be at ${DESIRED_IGNORE_PATH}`)}}catch(err){awaitexec(`git config --global core.excludesfile "${DESIRED_IGNORE_PATH}"`)awaitdiv(`Global gitconfig file configured to be at ${DESIRED_IGNORE_PATH}`)}}awaitensureGlobalGitIgnorePathConfigured()constcontent=awaitensureReadFile(DESIRED_IGNORE_PATH,"",{encoding: "utf-8"})constupdated=ensureDefaultEntriesPresent(content).trim()if(updated!==content){awaitwriteFile(DESIRED_IGNORE_PATH,updated,{encoding: "utf-8"})awaitdiv("Inserted default entries and wrote to file!")}constedited=(awaiteditor({value: updated})).trim()if(edited!==updated){awaitwriteFile(DESIRED_IGNORE_PATH,edited,{encoding: "utf-8"})startSpinner("dots",{initialMessage: "Writing..."})awaitwait(1200)awaitsubmit("done")}cache.defaultEntries=edited.split("\n")awaitcache.write()functionensureDefaultEntriesPresent(content: string): string{constlines=content.split("\n")for(constxofcache.defaultEntries){if(!lines.includes(x)){lines.unshift(x)}}returnlines.join("\n")}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Open edit-global-gitignore in Script Kit
It may make sense to unignore the
db/_edit-global-gitignore.json
database file if you want to share your global gitignore between computers (that share the same .kenv).As a JetBrains user, this script comes in very handy when needing to ignore some of the Plugin config files that are automatically created in the .idea folder:
Beta Was this translation helpful? Give feedback.
All reactions