mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2025-12-29 15:45:44 +01:00
Enabled update_files_before_start flag
This commit is contained in:
@@ -70,6 +70,9 @@ class Project:
|
||||
clear_directory(self.root_path)
|
||||
delete_all_app_development_data(self.args['app_id'])
|
||||
self.skip_steps = False
|
||||
elif 'update_files_before_start' in self.args and self.skip_until_dev_step is not None:
|
||||
FileSnapshot.delete().where(FileSnapshot.app == self.app and FileSnapshot.development_step == self.skip_until_dev_step).execute()
|
||||
self.save_files_snapshot(self.skip_until_dev_step)
|
||||
# TODO END
|
||||
|
||||
self.developer = Developer(self)
|
||||
|
||||
@@ -29,7 +29,8 @@ class CodeMonkey(Agent):
|
||||
}, IMPLEMENT_CHANGES)
|
||||
convo.remove_last_x_messages(1)
|
||||
|
||||
for file_data in changes:
|
||||
self.project.save_file(file_data)
|
||||
if (not self.project.args['update_files_before_start']) or (self.project.skip_until_dev_step != str(self.project.checkpoints['last_development_step'].id)):
|
||||
for file_data in changes:
|
||||
self.project.save_file(file_data)
|
||||
|
||||
return convo
|
||||
|
||||
@@ -107,12 +107,17 @@ class Developer(Agent):
|
||||
return True
|
||||
|
||||
self.run_command = convo.send_message('development/get_run_command.prompt', {})
|
||||
if self.run_command.startswith('`'):
|
||||
self.run_command = self.run_command[1:]
|
||||
if self.run_command.endswith('`'):
|
||||
self.run_command = self.run_command[:-1]
|
||||
|
||||
if continue_development:
|
||||
self.continue_development(convo)
|
||||
|
||||
def continue_development(self, iteration_convo):
|
||||
while True:
|
||||
# TODO add description about how can the user check if the app works
|
||||
user_feedback = self.project.ask_for_human_intervention(
|
||||
'Can you check if the app works?\nIf you want to run the app, ' + colored('just type "r" and press ENTER', 'yellow', attrs=['bold']),
|
||||
cbs={ 'r': lambda: run_command_until_success(self.run_command, None, iteration_convo, force=True) })
|
||||
|
||||
Reference in New Issue
Block a user