Skip to content

Commit ffee1ff

Browse files
committed
Improve auto-detected dev setups based on public repository data from Gitpod
1 parent b442c1c commit ffee1ff

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/config-inferrer.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export class ConfigInferrer {
4545
if (pckjson.scripts) {
4646
if (pckjson.scripts.build) {
4747
this.addCommand(ctx.config, command + ' run build', 'init');
48+
} else if (pckjson.scripts.compile) {
49+
this.addCommand(ctx.config, command + ' run compile', 'init');
4850
}
4951
if (pckjson.scripts.start) {
5052
this.addCommand(ctx.config, command + ' run start', 'command');
@@ -96,10 +98,17 @@ export class ConfigInferrer {
9698
return;
9799
}
98100
if (await ctx.exists('requirements.txt')) {
99-
this.addCommand(ctx.config, 'pip install -r ./requirements.txt', 'init');
101+
this.addCommand(ctx.config, 'pip install -r requirements.txt', 'init');
100102
} else if (await ctx.exists('setup.py')) {
101103
this.addCommand(ctx.config, 'pip install .', 'init');
102104
}
105+
if (await ctx.exists('main.py')) {
106+
this.addCommand(ctx.config, 'python main.py', 'command');
107+
} else if (await ctx.exists('app.py')) {
108+
this.addCommand(ctx.config, 'python app.py', 'command');
109+
} else if (await ctx.exists('runserver.py')) {
110+
this.addCommand(ctx.config, 'python runserver.py', 'command');
111+
}
103112
}
104113

105114
protected async checkGo(ctx: Context) {
@@ -125,9 +134,16 @@ export class ConfigInferrer {
125134
}
126135

127136
protected async checkRuby(ctx: Context) {
128-
if (await ctx.exists('Gemfile')) {
137+
if (await ctx.exists('bin/setup')) {
138+
this.addCommand(ctx.config, 'bin/setup', 'init');
139+
} else if (await ctx.exists('Gemfile')) {
129140
this.addCommand(ctx.config, 'bundle install', 'init');
130141
}
142+
if (await ctx.exists('bin/startup')) {
143+
this.addCommand(ctx.config, 'bin/startup', 'command');
144+
} else if (await ctx.exists('bin/rails')) {
145+
this.addCommand(ctx.config, 'bin/rails server', 'command');
146+
}
131147
}
132148

133149
protected addCommand(config: WorkspaceConfig, command: string, phase: 'before' | 'init' | 'command', unless?: string): void {

0 commit comments

Comments
 (0)