Adding a small if-else clause to change upload order

This is needed in order to support the strict dependency workflows
available when using Chef-Guard.
Merge pull request #1316 from svanharmelen/chef-guard-support

Adding a small if-else clause to change upload order