Skip to content

Instantly share code, notes, and snippets.

@jakeboxer
Created May 20, 2013 20:58
Show Gist options
  • Select an option

  • Save jakeboxer/5615495 to your computer and use it in GitHub Desktop.

Select an option

Save jakeboxer/5615495 to your computer and use it in GitHub Desktop.
function(dest, src){
// Split the src into an array of path components
srcComponents = src.split("/")
// Cut out the second to last one
srcComponents.splice(srcComponents.length - 2, 1)
// Join the path components back together into a path
newSrc = srcComponents.join("/")
return dest + newSrc
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment