#!/bin/bash
#
# apsk-mkdir-sharefols


#APSK_DEBUG_MODE=true
APSK_DEBUG_MODE=false


readonly App_Name="APSK Mkdir VirtualBox Shared Folders"
	readonly Short_Command_Name="apsk-mkdir-sharefols"

readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
	readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script")


		readonly Follpath____Apphome=$(readlink -m "$Follpath____This_Script/../..")

			readonly Follpath____Shared_Procedures="$Follpath____Apphome/Console Commands/Shared Procedures"

				readonly Fillepath____Prelim_Boilerplate="$Follpath____Shared_Procedures/Prelim Boilerplate"

					source "$Fillepath____Prelim_Boilerplate"


#gap


#-------------------------------------------------------------------------------


# 07:43:34 03/10/2018.  To change the language this script displays
# output in, run this command before running this script:
#
# 	export Language="Dog Language"
#
# 04:57:59 03/10/2018.  I don't understand any language other than English
# well enough to write a real translation, so the only other "language"
# available for now is Dog Language. :-)

Initialize_Translations



#-------------------------------------------------------------------------------

if [ -z "$1" ]
# 14:10:38 04/27/2018.  If there's no Arg #1, we can already abort.
then
	
	Help_Message
	
	
	#!!!!
	exit 1
fi


#-------------------------------------------------------------------------------

Get_All_Args "$@"

#printf 'pos arg %s\n' "${Positional_Args[@]}"


#!!!!
Require "$Fillepath____Figure_Out_Final_List_of_Sharefol_Lists" 120 "shared procedure"
	
	#!!!!
	Abort_if_Build_Final_List_of_Sharefols_Failed "$result_code_from_Build_Final_List_of_Sharefol_Lists"


	# 2020-08-28 18:09:03.  If you don't skip early valichecking,
	# this app will abort if any shared folder list has flaws.
	#
	# Skipping the early valichecks lets you use imperfect lists.
	# Good lines will be used and bad lines will simply be skipped.
	# 2020-08-31 00:41:35. And a warning message will be shown
	# listing any problems encountered.


#!!!!
Require "$Fillepath____Libraries_for_Valichecking_Sharefol_Lists" 123 "shared procedure"

	
if [ "$should_skip_early_valichecks" = true ]
then
	echo "Skipping early valichecks, which means all valid lines of even invalid sharefol list files will be used."
else
	
	
	#!!!!
	Require "$Fillepath____Valicheck_Final_List_of_Sharefol_Lists" 121 "shared procedure"


	echo
	echo
	echo "All lists passed early valichecks!"
	
fi


#!!!!
Require "$Fillepath____Mkdir_Final_List_of_Sharefol_Lists" 122 "shared procedure"



Console_and_Copyable_Dialog_Box____Message "$ret_winmsg" "Succeeded - $Short_Command_Name"

echo "ret winmsg: '$ret_winmsg'"
#decho "decho!"
Clean_Up_Translations_Stuff


#!!!!
exit 0