Skip to content

Instantly share code, notes, and snippets.

@richardjoo
Created September 14, 2012 03:18
Show Gist options
  • Save richardjoo/3719594 to your computer and use it in GitHub Desktop.
Save richardjoo/3719594 to your computer and use it in GitHub Desktop.
setting up path on both ACF and Railo
<cfif len(CGI.PATH_INFO)>
<!--- Mainly for ACF on windows server --->
<cfset PathInfo = CGI.PATH_INFO />
<cfelse>
<!--- for example, on Linux Railo running Apache, CGI.PATH_INFO = "" --->
<cfset PathInfo = getPageContext().getRequest().getAttribute('requestedPath') />
<cfif isNull(PathInfo)>
<cfset PathInfo = "" />
<cfelseif PathInfo.startsWith(CGI.SCRIPT_NAME)>
<cfset PathInfo = PathInfo.substring(len(CGI.SCRIPT_NAME)) />
</cfif>
</cfif>
<!--- if it is HTTPS protocol --->
<cfif cgi.server_port does not contain "443">
<cfif len(PathInfo)>
<cfset jsPath="#replace(GetDirectoryFromPath("http://" & cgi.server_name & PathInfo),"\","")#" />
<cfelse>
<cfset jsPath="http://" & cgi.server_name & "/GIP/Accounting/" />
</cfif>
<cfelse>
<!--- this is HTTP protocol --->
<cfif len(PathInfo)>
<cfset jsPath="#replace(GetDirectoryFromPath("https://"& cgi.server_name & PathInfo),"\","")#" />
<cfelse>
<!--- Darn thing about Linux Railo with Apache running, the path info is more likely be empty.
Whatever the reason is, if you still get no info on PathInfo, you should write the path manually --->
<cfset jsPath="https://" & cgi.server_name & "/Main/ThisFolder/" />
</cfif>
</cfif>
<!---
Now, say, I am attaching the js file, and js file is under Main/js folder,
Then, you would erase "ThisFolder" from the path, and add js folder with file name
--->
<cfset jsPath="#RemoveChars(jsPath, Len(jsPath)-10, 11)#js/myJavascrip.js" />
echo 'git pull'
git pull
echo 'git status'
git status
echo 'git add . --all'
git add . --all
echo 'git status'
git status
echo 'git files checked / added / updated'
git commit -am 'files checked / added / updated'
echo 'git push'
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment