mirror of
				https://github.com/Unstructured-IO/unstructured.git
				synced 2025-11-04 03:53:45 +00:00 
			
		
		
		
	### Description Given all the shell files that now exist in the repo, would be nice to have linting/formatting around them (in addition to the existing shellcheck which doesn't do anything to format the shell code). This PR introduces `shfmt` to both check for changes and apply formatting when the associated make targets are called.
		
			
				
	
	
		
			17 lines
		
	
	
		
			469 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			469 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
 | 
						|
# Description:
 | 
						|
#
 | 
						|
# Arguments:
 | 
						|
#   $1 folder with json files to process
 | 
						|
#   $2 folder to place the text field for all entries, for all files at $1
 | 
						|
 | 
						|
set +e
 | 
						|
SCRIPT_DIR=$(dirname "$(realpath "$0")")
 | 
						|
INPUT_FOLDER_NAME=$1
 | 
						|
OUTPUT_DIR_TEXT=$2
 | 
						|
echo "CLEANING FOLDER: $INPUT_FOLDER_NAME"
 | 
						|
echo "INTO: $OUTPUT_DIR_TEXT"
 | 
						|
mkdir -p "$OUTPUT_DIR_TEXT"
 | 
						|
find "$INPUT_FOLDER_NAME" -type f -print0 | xargs -0 -IX -n1 "$SCRIPT_DIR"/json-to-text.sh X "$OUTPUT_DIR_TEXT"
 |