mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-10-31 19:00:54 +00:00 
			
		
		
		
	fixed how settings.yaml is written
This commit is contained in:
		
							parent
							
								
									9b3fce3cbf
								
							
						
					
					
						commit
						2abaa7415d
					
				| @ -11,12 +11,12 @@ def load_environment(): | ||||
|     return env | ||||
| 
 | ||||
| def write_settings(config, env): | ||||
|     fn = os.path.join(env['STORAGE_ROOT'], 'settings.yaml') | ||||
|     fn = sys.argv[2] | ||||
|     with open(fn, "w") as f: | ||||
|         f.write(rtyaml.dump(config)) | ||||
| 
 | ||||
| def load_settings(env): | ||||
|     fn = os.path( sys.argv[2] ) | ||||
|     fn = sys.argv[2] | ||||
|     try: | ||||
|         config = rtyaml.load(open(fn, "r")) | ||||
|         if not isinstance(config, dict): raise ValueError() # caught below | ||||
| @ -42,4 +42,3 @@ if(sys.argv[2]): | ||||
| 
 | ||||
| 		config["mailinabox-agreement"] = True | ||||
| 		write_settings( config, env ) | ||||
| 		print("true") | ||||
| @ -274,9 +274,5 @@ function set_config_agreed { | ||||
| 	fi | ||||
| 
 | ||||
| 	local current_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||||
| 	local yaml_agreed=$(python "${current_directory}"/agreement.py set "${STORAGE_ROOT}settings.yaml"; echo $?) | ||||
| 	if [ "$yaml_agreed" == "true" ]; then | ||||
| 		return 0 | ||||
| 	fi | ||||
| 	return 1 | ||||
| 	python "${current_directory}"/agreement.py set "${STORAGE_ROOT}"/settings.yaml | ||||
| } | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user