1decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary#!/bin/sh 2decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary# Copyright 2015 Google Inc. 3decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary# 4decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary# Use of this source code is governed by a BSD-style license that can be 5decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary# found in the LICENSE file. 6decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary 7decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary# Parse the output of fiddle_main, for use in testing 8decb21e3ae3d296976d8664e49e35971d1b4faddhalcanarywhile IFS= read -r line; do 9decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary type=$(echo $line | sed -n 's/[^"]*"\([^"]*\)":.*/\1/p') 10decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary if [ "$type" ]; then 11decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary case "$type" in 1297b10ac4847fba563834911f35235aaf0299d0c8Joe Gregorio Raster|Gpu) ext='.png';; 1397b10ac4847fba563834911f35235aaf0299d0c8Joe Gregorio Pdf) ext='.pdf';; 1497b10ac4847fba563834911f35235aaf0299d0c8Joe Gregorio Skp) ext='.skp';; 1597b10ac4847fba563834911f35235aaf0299d0c8Joe Gregorio Text|GLInfo) ext='.txt';; 16decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary esac 17decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary dst="${TMPDIR:-/tmp}/fiddle_${type}${ext}" 18decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary echo $line | sed 's/[^"]*"[^"]*": "//; s/"\(,\|\)$//' \ 19decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary | base64 -d > "$dst" 20decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary echo $dst 21decb21e3ae3d296976d8664e49e35971d1b4faddhalcanary fi 22decb21e3ae3d296976d8664e49e35971d1b4faddhalcanarydone 23