Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't create evidence.settings.json #2842

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fuzzy-radios-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'evidence-vscode': patch
---

dont create legacy file on new project
7 changes: 1 addition & 6 deletions packages/evidence/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ const populateTemplate = function () {
// - local settings
// - telemetry profile
// - static folder (mainly to preserve the data directory)
const keepers = new Set([
'evidence.settings.json',
'.profile.json',
'static',
'.evidence-queries'
]);
const keepers = new Set(['.profile.json', 'static', '.evidence-queries']);
fs.readdirSync('./.evidence/template/').forEach((file) => {
if (!keepers.has(file)) fs.removeSync(path.join('./.evidence/template/', file));
});
Expand Down
1 change: 0 additions & 1 deletion packages/extension/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ node_modules/**
template/node_modules/**
template/build/**
template/.evidence/template/**
!template/.evidence/template/evidence.settings.json
data/**
src/**

Expand Down
11 changes: 0 additions & 11 deletions packages/extension/src/commands/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,6 @@ export async function cloneTemplateRepository(
message: 'Finished cloning template project.'
});

// degit.json does not seem to be respected by tiged in this case
// add credentials file to .evidence/template/evidence.settings.json if it is using default template, and also delete the degit.json file
if (templateRepositoryUrl === templateProjectUrl) {
let credentialsString = `{"database":"duckdb","credentials":{"filename":"needful_things.duckdb","gitignoreDuckdb":null}}`;
await workspace.fs.writeFile(
Uri.file(`${projectFolderPath}/.evidence/template/evidence.settings.json`),
Buffer.from(credentialsString)
);
await workspace.fs.delete(Uri.file(`${projectFolderPath}/degit.json`));
}

// update Evidence project context and status bar
updateProjectContext();

Expand Down