dorky 2.2.2 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/bin/index.js +17 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,7 +87,9 @@ Anyhow, we shall store it on a private storage, using **dorky**, that stores it
|
|
|
87
87
|
[*] List remote files in dorky bucket.
|
|
88
88
|
[*] Auto detect .env and .config files.
|
|
89
89
|
[*] Update node version to latest LTS.
|
|
90
|
-
[
|
|
90
|
+
[*] Ignore dorky files in dorky itself.
|
|
91
|
+
[*] Update .gitignore automatically, to ignore .dorky/credentials.json.
|
|
92
|
+
[ ] Handle reauthentication loop for google-drive.
|
|
91
93
|
[ ] Extension for VS Code to list and highlight them like git.
|
|
92
94
|
[ ] Unintialize dorky setup.
|
|
93
95
|
[ ] MCP server.
|
package/bin/index.js
CHANGED
|
@@ -86,6 +86,19 @@ function setupFilesAndFolders(metaData, credentials) {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
function updateGitIgnore() {
|
|
90
|
+
let gitignoreContent = "";
|
|
91
|
+
if (existsSync(".gitignore")) {
|
|
92
|
+
gitignoreContent = fs.readFileSync(".gitignore").toString();
|
|
93
|
+
}
|
|
94
|
+
const dorkyIgnoreEntry = ".dorky/credentials.json";
|
|
95
|
+
if (!gitignoreContent.includes(dorkyIgnoreEntry)) {
|
|
96
|
+
gitignoreContent += EOL + dorkyIgnoreEntry + EOL;
|
|
97
|
+
fs.writeFileSync(".gitignore", gitignoreContent);
|
|
98
|
+
console.log(`${chalk.bgGreen("Updated .gitignore to ignore .dorky/credentials.json.")} ${chalk.red("⚠️ This is done to protect your credentials.")}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
89
102
|
async function authorizeGoogleDriveClient() {
|
|
90
103
|
async function loadSavedCredentialsIfExist() {
|
|
91
104
|
try {
|
|
@@ -124,6 +137,7 @@ async function init(storage) {
|
|
|
124
137
|
console.log("Please provide a valid storage option <aws|google-drive>");
|
|
125
138
|
break;
|
|
126
139
|
}
|
|
140
|
+
updateGitIgnore();
|
|
127
141
|
}
|
|
128
142
|
|
|
129
143
|
async function list(type) {
|
|
@@ -149,6 +163,9 @@ async function list(type) {
|
|
|
149
163
|
for (let i = 0; i < exclusions.length; i++) {
|
|
150
164
|
if (file.includes(exclusions[i])) return false;
|
|
151
165
|
}
|
|
166
|
+
if (file.includes(".dorky/")) return false;
|
|
167
|
+
if (file.endsWith(".dorky") && fs.lstatSync(file).isDirectory()) return false;
|
|
168
|
+
if (file.endsWith(".dorkyignore")) return false;
|
|
152
169
|
return true;
|
|
153
170
|
});
|
|
154
171
|
filteredFiles.forEach((file) => {
|