Skip to content

Commit

Permalink
Merge pull request #18 from BadStreff/bradschm-patch-1
Browse files Browse the repository at this point in the history
Add support for Ruby and env paths to sh and bash
  • Loading branch information
badstreff authored Nov 5, 2018
2 parents e8f0e84 + 93acd20 commit 8e2d265
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# Use this variable to add a Slack emoji in front of each item if you use a post-build action for a Slack custom message
slack_emoji = ":white_check_mark: "

supported_script_extensions = ('sh', 'py', 'pl', 'swift')
supported_ea_extensions = ('sh', 'py', 'pl', 'swift')
supported_script_extensions = ('sh', 'py', 'pl', 'swift', 'rb')
supported_ea_extensions = ('sh', 'py', 'pl', 'swift', 'rb')
supported_profile_extensions = ('.mobileconfig', '.profile')


Expand Down
11 changes: 10 additions & 1 deletion tools/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,16 @@ def download_scripts(mode, overwrite=None,):
# Determine the file extension
if '#!/bin/sh' in ET.tostring(tree.find(script_xml), encoding='unicode', method='text'):
ext = '.sh'


elif '#!/usr/bin/env sh' in ET.tostring(tree.find(script_xml), encoding='unicode', method='text'):
ext = '.sh'

elif '#!/bin/bash' in ET.tostring(tree.find(script_xml), encoding='unicode', method='text'):
ext = '.sh'

elif '#!/usr/bin/env bash' in ET.tostring(tree.find(script_xml), encoding='unicode', method='text'):
ext = '.sh'

elif '#!/usr/bin/python' in ET.tostring(tree.find(script_xml), encoding='unicode', method='text'):
ext = '.py'

Expand All @@ -107,6 +113,9 @@ def download_scripts(mode, overwrite=None,):
elif '#!/usr/bin/perl' in ET.tostring(tree.find(script_xml), encoding='unicode', method='text'):
ext = '.pl'

elif '#!/usr/bin/ruby' in ET.tostring(tree.find(script_xml), encoding='unicode', method='text'):
ext = '.rb'

else:
print('No interpreter directive found for: ', tree.find('name').text)
ext = '.sh' # Call it sh for now so the uploader detects it
Expand Down

0 comments on commit 8e2d265

Please sign in to comment.