created new build script, and accomodated to new file names

This commit is contained in:
Samuel Vasko 2013-09-28 20:38:52 +02:00
parent 2521097f72
commit eaa78c6bf3
4 changed files with 80 additions and 5 deletions

View File

@ -1,2 +1,2 @@
@echo off
start vendor/ConEmu/ConEmu.exe /Title Cmder /LoadCfgFile ../../config/ConEmu.xml
start vendor/conemu-maximus5/ConEmu.exe /Title Cmder /LoadCfgFile ../../config/ConEmu.xml

66
build_cmder.rb Normal file
View File

@ -0,0 +1,66 @@
# Samuel Vasko 2013
# Cmder build script
# Like really a beta
require 'FileUtils'
require "pp"
def get_file project, query
# Should be changed to integrated downloader
urlToFile = 'wget -q -O - "http://samuelvasko.tk/gcode/?project='+project+'&query='+query+'"'
urlToFile = `#{urlToFile}`
urlToFile = urlToFile.split("\n").first
extension = urlToFile.split('.').last
filename = project+'.'+extension
puts "\n ------ Downloading #{project} ------- \n \n"
get_file = system("wget -O #{filename} -nc #{urlToFile}")
unless get_file
puts "Failied to download #{project} from #{urlToFile}"
FileUtils.rm(filename) if File.exists?(filename)
exit(1)
end
system("7z x -o\"#{project}\" #{project}.#{extension}")
File.unlink(project+"."+extension);
# When the folder contains another folder
# that is not what we want
if Dir.glob("#{project}/*").length == 1
temp_name = "#{project}_temp"
FileUtils.mv(project, temp_name)
FileUtils.mv(Dir.glob("#{temp_name}/*")[0], project)
FileUtils.rm_r(temp_name)
end
end
puts '
______ _ _ _ _ _
| ___ \ (_) | | (_) | |
| |_/ /_ _ _| | __| |_ _ __ __ _ ___ _ __ ___ __| | ___ _ __
| ___ \ | | | | |/ _` | | \'_ \ / _` | / __| \'_ ` _ \ / _` |/ _ \ \'__|
| |_/ / |_| | | | (_| | | | | | (_| | | (__| | | | | | (_| | __/ |
\____/ \__,_|_|_|\__,_|_|_| |_|\__, | \___|_| |_| |_|\__,_|\___|_|
__/ |
|___/
'
puts 'Cleanup'
if Dir.exists?('vendor')
Dir.glob('vendor/*') { |file| FileUtils.rm_rf(file) if File.directory?(file) }
end
Dir.chdir('vendor')
puts 'Getting files'
get_file('clink', 'label:Type-Archive label=Featured')
get_file('conemu-maximus5', 'label:Type-Archive label=Preview label=Featured')
get_file('msysgit', 'label:Type-Archive label:Featured')
puts 'Done, bye'

2
vendor/Readme.md vendored
View File

@ -1,3 +1,3 @@
## Vendor
Softwere from third parties + init sctipt
Softwere from third parties + init sctipt

15
vendor/init.bat vendored
View File

@ -1,6 +1,10 @@
:: Set prompt style
@for /f "tokens=2 delims=:." %%x in ('chcp') do @set cp=%%x
:: Init Script for cmd.exe
:: Sets some nice defaults
:: Created as part of cmder project
:: Seting prompt style
@for /f "tokens=2 delims=:." %%x in ('chcp') do @set cp=%%x
:: The slow part
:: World without Unicode is a sad world
@chcp 65001>nul
@ -8,6 +12,7 @@
@prompt $E[1;32;40m$P $_$E[1;30;40mλ $E[0m
@chcp %cp%>nul
:: Pick right version of clink
@if "%PROCESSOR_ARCHITECTURE%"=="x86" (
set architecture=86
@ -15,10 +20,12 @@
set architecture=64
)
:: Run clink
@vendor\clink\clink_x%architecture%.exe inject --quiet --profile config
:: Prepare for msysgit
:: I do not even know, copypasted from their .bat
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@set PLINK_PROTOCOL=ssh
@ -26,7 +33,7 @@
:: Enhance Path
@set rootDir=%CD%
@set git_install_root=%CD%\vendor\PortableGit
@set git_install_root=%CD%\vendor\msysgit
@set PATH=%PATH%;%rootDir%\bin;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;
:: Add aliases
@ -34,3 +41,5 @@
:: cd into users homedir
@cd /d "%userprofile%"
echo Welcome to cmder!