mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-30 23:47:31 +03:00 
			
		
		
		
	Update project init
This commit is contained in:
		
							parent
							
								
									c96b4a37b6
								
							
						
					
					
						commit
						8979dc254f
					
				|  | @ -117,20 +117,30 @@ def project_init_cli( | ||||||
|     typically be taken care of automatically when you run the "project clone" |     typically be taken care of automatically when you run the "project clone" | ||||||
|     command. |     command. | ||||||
|     """ |     """ | ||||||
|     project_init(path, git=git) |     project_init(path, git=git, silent=True) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def project_init(dest: Path, *, git: bool = False): | def project_init( | ||||||
|  |     dest: Path, *, git: bool = False, silent: bool = False, analytics: bool = False | ||||||
|  | ): | ||||||
|     with working_dir(dest): |     with working_dir(dest): | ||||||
|         # TODO: check that .dvc exists in other commands? |         # TODO: check that .dvc exists in other commands? | ||||||
|         init_cmd = ["dvc", "init"] |         init_cmd = ["dvc", "init"] | ||||||
|  |         if silent: | ||||||
|  |             init_cmd.append("--quiet") | ||||||
|         if not git: |         if not git: | ||||||
|             init_cmd.append("--no-scm") |             init_cmd.append("--no-scm") | ||||||
|         if git: |         if git: | ||||||
|             run_command(["git", "init"]) |             run_command(["git", "init"]) | ||||||
|         run_command(init_cmd) |         run_command(init_cmd) | ||||||
|  |         if not analytics: | ||||||
|             # TODO: find a better solution for this? |             # TODO: find a better solution for this? | ||||||
|             run_command(["dvc", "config", "core.analytics", "false"]) |             run_command(["dvc", "config", "core.analytics", "false"]) | ||||||
|  |         config = load_project_config(dest) | ||||||
|  |         with msg.loading("Updating DVC config..."): | ||||||
|  |             updated = update_dvc_config(dest, config, silent=True) | ||||||
|  |         if updated: | ||||||
|  |             msg.good(f"Updated DVC config from {CONFIG_FILE}") | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @project_cli.command("assets") | @project_cli.command("assets") | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user