Home / Function/ init() — astro Function Reference

init() — astro Function Reference

Architecture documentation for the init() function in git.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  4ebcb86a_c096_d7e6_00c4_0fd19877bf72["init()"]
  86455456_bee6_f020_bc22_ec5ab2dbdbe1["git.ts"]
  4ebcb86a_c096_d7e6_00c4_0fd19877bf72 -->|defined in| 86455456_bee6_f020_bc22_ec5ab2dbdbe1
  b8e2bfc1_004d_846a_3dd7_e51b44d009ea["git()"]
  b8e2bfc1_004d_846a_3dd7_e51b44d009ea -->|calls| 4ebcb86a_c096_d7e6_00c4_0fd19877bf72
  style 4ebcb86a_c096_d7e6_00c4_0fd19877bf72 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/create-astro/src/actions/git.ts lines 48–63

async function init({ cwd }: { cwd: string }) {
	try {
		await shell('git', ['init'], { cwd, stdio: 'ignore' });
		await shell('git', ['add', '-A'], { cwd, stdio: 'ignore' });
		await shell(
			'git',
			[
				'commit',
				'-m',
				'"Initial commit from Astro"',
				'--author="houston[bot] <astrobot-houston@users.noreply.github.com>"',
			],
			{ cwd, stdio: 'ignore' },
		);
	} catch {}
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does init() do?
init() is a function in the astro codebase, defined in packages/create-astro/src/actions/git.ts.
Where is init() defined?
init() is defined in packages/create-astro/src/actions/git.ts at line 48.
What calls init()?
init() is called by 1 function(s): git.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free