@@ -1324,7 +1324,7 @@ def make_quarto_manifest(
13241324 # Standalone Quarto document
13251325 base_dir = dirname (file_or_directory )
13261326 file_name = basename (file_or_directory )
1327- relevant_files = [file_name ] + extra_files
1327+ relevant_files = [file_name ] + list ( extra_files or [])
13281328
13291329 manifest = make_source_manifest (
13301330 app_mode ,
@@ -2015,7 +2015,7 @@ def describe_manifest(
20152015
20162016
20172017def write_quarto_manifest_json (
2018- directory : str ,
2018+ file_or_directory : str ,
20192019 inspect : typing .Any ,
20202020 app_mode : AppMode ,
20212021 environment : Environment ,
@@ -2028,7 +2028,7 @@ def write_quarto_manifest_json(
20282028 """
20292029 Creates and writes a manifest.json file for the given Quarto project.
20302030
2031- :param directory : The directory containing the Quarto project.
2031+ :param file_or_directory : The Quarto document or the directory containing the Quarto project.
20322032 :param inspect: The parsed JSON from a 'quarto inspect' against the project.
20332033 :param app_mode: The application mode to assume (such as AppModes.STATIC_QUARTO)
20342034 :param environment: The (optional) Python environment to use.
@@ -2041,12 +2041,20 @@ def write_quarto_manifest_json(
20412041 The server administrator is responsible for installing packages in the runtime environment. Default = None.
20422042 """
20432043
2044- extra_files = validate_extra_files (directory , extra_files )
20452044 manifest , _ = make_quarto_manifest (
2046- directory , inspect , app_mode , environment , extra_files , excludes , image , env_management_py , env_management_r
2045+ file_or_directory ,
2046+ inspect ,
2047+ app_mode ,
2048+ environment ,
2049+ extra_files ,
2050+ excludes ,
2051+ image ,
20472052 )
2048- manifest_path = join (directory , "manifest.json" )
20492053
2054+ base_dir = file_or_directory
2055+ if not isdir (file_or_directory ):
2056+ base_dir = dirname (file_or_directory )
2057+ manifest_path = join (base_dir , "manifest.json" )
20502058 write_manifest_json (manifest_path , manifest )
20512059
20522060
0 commit comments