Skip to content
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
2 changes: 1 addition & 1 deletion src/newProject/newProjectPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Logger } from "../logger/logger";
import { OutputChannel } from "../logger/outputChannel";
import { INewProjectArgs } from "./newProjectInit";
import { IComponent } from "../espIdf/idfComponent/IdfComponent";
import { copy, ensureDir, readFile, writeJSON } from "fs-extra";
import { copy, ensureDir, readFile, writeFile, writeJSON } from "fs-extra";
import * as utils from "../utils";
import { IExample } from "../examples/Example";
import { setCurrentSettingsInTemplate } from "./utils";
Expand Down
10 changes: 10 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,15 @@ export async function createVscodeFolder(curWorkspaceFsPath: vscode.Uri) {
await setCCppPropertiesJsonCompilerPath(curWorkspaceFsPath);
}

export async function createGitignoreFile(destinationDir: vscode.Uri) {
const gitignoreSrcPath = path.join(templateDir, ".gitignore");
const gitignoreDestPath = path.join(destinationDir.fsPath, ".gitignore");
const gitignoreExists = await pathExists(gitignoreSrcPath);
if (gitignoreExists) {
await copy(gitignoreSrcPath, gitignoreDestPath);
}
}

export async function setCCppPropertiesJsonCompilerPath(
curWorkspaceFsPath: vscode.Uri
) {
Expand Down Expand Up @@ -408,6 +417,7 @@ export async function copyFromSrcProject(
await copy(srcDirPath, destinationDir.fsPath);
await createVscodeFolder(destinationDir);
await createDevContainer(destinationDir.fsPath);
await createGitignoreFile(destinationDir);
}

export function getVariableFromCMakeLists(workspacePath: string, key: string) {
Expand Down
78 changes: 78 additions & 0 deletions templates/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# macOS
.DS_Store
.AppleDouble
.LSOverride

# Directory metadata
.directory

# Temporary files
*~
*.swp
*.swo
*.bak
*.tmp

# Log files
*.log

# Build artifacts and directories
**/build/
build/
*.o
*.a
*.out
*.exe # For any host-side utilities compiled on Windows

# ESP-IDF specific build outputs
*.bin
*.elf
*.map
flasher_args.json # Generated in build directory
sdkconfig.old
sdkconfig

# ESP-IDF dependencies
# For older versions or manual component management
/components/.idf/
**/components/.idf/
# For modern ESP-IDF component manager
managed_components/
# If ESP-IDF tools are installed/referenced locally to the project
.espressif/

# CMake generated files
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
install_manifest.txt
CTestTestfile.cmake

# Python environment files
*.pyc
*.pyo
*.pyd
__pycache__/
*.egg-info/
dist/

# Virtual environment folders
venv/
.venv/
env/

# Language Servers
.clangd/
.ccls-cache/
compile_commands.json

# Windows specific
Thumbs.db
ehthumbs.db
Desktop.ini

# User-specific configuration files
*.user
*.workspace # General workspace files, can be from various tools
*.suo # Visual Studio Solution User Options
*.sln.docstates # Visual Studio