This commit is contained in:
Unknown
2018-02-04 23:31:16 -05:00
parent 101437ead3
commit ef1fb47d0e
5 changed files with 16 additions and 101 deletions

View File

@@ -1,90 +0,0 @@
id,name,cost,type,resolve,speed,damage,toughness,life,shorttext,longtext,flavortext,card_image,common,uncommon,rare,action,event,continuous,item,bast,igrath,lilith,vi,ravat,scuttler,tendril,wisp,scinter,tinsel,show_resolve,show_speed,show_tough,show_life,border_normal
Blaze,"Blaze",1,"Event- Channel","+0",0,0,0,0,"Deal 1 to a follower.
Draw 1.","Channeled cards can only be played with their leader's resolve","","F:\GitLab\dreamkeepers-psd\Images\Bast\Blaze.png",true,false,false,false,true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,true
Chaotic Blast,"Chaotic Blast",3,"Event- Channel","+0",0,0,0,0,"Bast deals 2 to all other characters.
Nearby characters take +1 damage.","Characters in the same lane are considered nearby.
Bast does not take damage.
Channeled cards can only be played with their leader's resolve","","F:\GitLab\dreamkeepers-psd\Images\Bast\Chaotic Blast.png",false,true,false,false,true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false
Combust,"Combust",1,"Action- Channel","+0",0,0,0,0,"Deal 2 to a character.","Channeled cards can only be played with their leader's resolve","","F:\GitLab\dreamkeepers-psd\Images\Bast\Combust.png",true,false,false,true,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,true
Hot Coals,"Hot Coals",3,"Event- Continuous","+0",0,0,0,0,"If you would draw a card, you may put a discarded Bast channel card into your hand instead.","","","F:\GitLab\dreamkeepers-psd\Images\Bast\Hot Coals.png",false,true,false,false,true,true,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false
Ignite,"Ignite",1,"Action- Channel","+0",0,0,0,0,"Deal 3 to a hero.","Ignite can be played on Leaders, bonus heroes, or deck heroes.
Channeled cards can only be played with their leader's resolve.","","F:\GitLab\dreamkeepers-psd\Images\Bast\Ignite.png",true,false,false,true,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,true
Kindle,"Kindle",2,"Event","+0",0,0,0,0,"Reveal the top 4 cards of your deck. Put 2 Bast Channel cards from among them into your hand and discard the rest.","","","F:\GitLab\dreamkeepers-psd\Images\Bast\Kindle.png",true,false,false,false,true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,true
Relentless Fury,"Relentless Fury",3,"Event","+0",0,0,0,0,"You may move a Troika hero.
That hero gains +1 speed this turn.","Speed is spent to attack, intercept, or redeploy.
Move means to put that character in another zone, this does not count as a redeployment.","","F:\GitLab\dreamkeepers-psd\Images\Bast\Relentless Fury.png",false,false,true,false,true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,true
Rush of Anger,"Rush of Anger",2,"Event","+0",0,0,0,0,"A character gets +3/+0 this turn.","You may target any character- even your opponent's.
You may play Rush of Anger on a hero or follower.","","F:\GitLab\dreamkeepers-psd\Images\Bast\Rush of Anger.png",false,false,true,false,true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,true
Savage Punch,"Savage Punch",2,"Event","+0",0,0,0,0,"A Troika hero deals its damage to a nearby character.","Characters in the same lane are considered nearby.","","F:\GitLab\dreamkeepers-psd\Images\Bast\Savage Punch.png",false,false,true,false,true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false,tru
Bushwack Squad,"Bushwack Squad",1,"Follower","+0",1,1,1,0,"Uncontested- +2/+1.","If your opponent controls no nearby characters, this character gets +2/+1.","Our chief weapon is surprise! Surprise and guns, guns and surprise... Our two weapons are guns and surprise... And ruthless sarcasm! Our three weapons are...","F:\GitLab\dreamkeepers-psd\Images\Igrath\Bushwack Squad.png",true,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,true
Drastic Measures,"Drastic Measures",1,"Event","+0",0,0,0,0,"Discard a non-leader card from a lane, its controller draws 1.","Deck heroes count as non-leader cards.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Drastic Measures.png",true,false,false,false,true,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,true
High Ground,"High Ground",3,"Event- Continuous","+0",0,0,0,0,"Uncontested- characters can't deploy or redeploy to this lane.","If your opponent controls nearby characters, this card does nothing.
Characters are nearby if they're in the same lane as this card.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\High Ground.png",false,false,true,false,true,true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false
Loyal Trooper_1,"Loyal Trooper",2,"Follower","+0",1,1,3,0,"Uncontested- +2/+0.","If your opponent controls no nearby characters, this character gets +2/+0.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Loyal Trooper\Loyal Trooper_Ashworth.png",true,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,true
Loyal Trooper_2,"Loyal Trooper",2,"Follower","+0",1,1,3,0,"Uncontested- +2/+0.","If your opponent controls no nearby characters, this character gets +2/+0.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Loyal Trooper\Loyal Trooper_Leopard.png",true,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,true
Loyal Trooper_3,"Loyal Trooper",2,"Follower","+0",1,1,3,0,"Uncontested- +2/+0.","If your opponent controls no nearby characters, this character gets +2/+0.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Loyal Trooper\Loyal Trooper_std.png",true,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,true
Overlooked Advantage,"Overlooked Advantage",1,"Event","+0",0,0,0,0,"Move a character.
Draw 1.","Move means to put that character in another zone, this does not count as a redeployment.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Overlooked Advantage.png",false,false,true,false,true,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,true
Overwhelming Odds,"Overwhelming Odds",4,"Event","+0",0,0,0,0,"Characters in uncontested lanes gain +1 speed this turn.","Lanes are uncontested if your opponent controls no characters in them.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Overwhelming Odds.png",false,true,false,false,true,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,false
Troika Tactician_1,"Troika Tactician",1,"Follower","+0",1,1,2,0,"Uncontested- nearby followers get +1/+1.","If your opponent controls no nearby characters, your nearby followers get +1/+1.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Troika Tactician\Troika Tactician_Altharin.png",false,false,true,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,true
Troika Tactician_2,"Troika Tactician",1,"Follower","+0",1,1,2,0,"Uncontested- nearby followers get +1/+1.","If your opponent controls no nearby characters, your nearby followers get +1/+1.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Troika Tactician\Troika Tactician_Konig.png",false,false,true,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,true
Springtrigger Vanguard_1,"Springtrigger Vanguard",3,"Follower","+0",1,2,3,0,"Uncontested- +2/+1.","If your opponent controls no nearby characters, this character gets +2/+1.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Springtrigger Vanguard\Springtrigger Vanguard_Goldobsidian.png",false,false,true,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,true
Springtrigger Vanguard_2,"Springtrigger Vanguard",3,"Follower","+0",1,2,3,0,"Uncontested- +2/+1.","If your opponent controls no nearby characters, this character gets +2/+1.","","F:\GitLab\dreamkeepers-psd\Images\Igrath\Springtrigger Vanguard\Springtrigger Vanguard_Other.png",false,false,true,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,true
Ruskol District Striker_1,"Ruskol District Striker",3,"Follower","+0",1,3,3,0,"Ambush.","You may play this character at any time, even during your opponent's turn.","Please, dont call it a trap. We prefer the term understated assault.","F:\GitLab\dreamkeepers-psd\Images\Igrath\Ruskol District Striker\Ruskol District Striker_Arty.png",false,false,true,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,true
Ruskol District Striker_2,"Ruskol District Striker",3,"Follower","+0",1,3,3,0,"Ambush.","You may play this character at any time, even during your opponent's turn.","Please, dont call it a trap. We prefer the term understated assault.","F:\GitLab\dreamkeepers-psd\Images\Igrath\Ruskol District Striker\Ruskol District Striker_std.png",false,false,true,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true,true,false,tru
Calah's Trusted,"Calah's Trusted",4,"Follower","+0",1,2,4,0,"Guard, Stealth, Deadly.","This character can intercept even when attacked, can only be attacked by nearby characters, and always deals lethal damage.","","F:\GitLab\dreamkeepers-psd\Images\Lilith\Calah's Trusted.png",false,false,true,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,true,true,false,true
Devotion,"Devotion",1,"Event- Continuous","+0",0,0,0,0,"When a Troika character intercepts, they get +1 speed this turn.","Speed is spent to attack, intercept, or redeploy","","F:\GitLab\dreamkeepers-psd\Images\Lilith\Devotion.png",false,false,true,false,true,true,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false
Distraction,"Distraction",1,"Action","+0",0,0,0,0,"Remove a character from a skirmish.
It can't be attacked this turn.","That character takes and deals no damage this skirmish.","","F:\GitLab\dreamkeepers-psd\Images\Lilith\Distraction.png",true,false,false,true,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false
Never Unprepared,"Never Unprepared",2,"Event","+0",0,0,0,0,"Draw 3.","","","F:\GitLab\dreamkeepers-psd\Images\Lilith\Never Unprepared.png",false,true,false,false,true,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,false
Peek,"Peek",1,"Event","+0",0,0,0,0,"Prevent 2 damage that would be dealt this turn.","","","F:\GitLab\dreamkeepers-psd\Images\Lilith\Peek.png",true,false,false,false,true,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,true
Quick Thinking,"Quick Thinking",1,"Event","+0",0,0,0,0,"Draw 1, then Replace 2.","You may discard 1 and draw 1, up to 2 times.","","F:\GitLab\dreamkeepers-psd\Images\Lilith\Quick Thinking.png",false,false,true,false,true,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,true
Sabbaton Elite,"Sabbaton Elite",3,"Follower","+0",1,3,4,0,"Guard.","This character can intercept even when attacked.","","F:\GitLab\dreamkeepers-psd\Images\Lilith\Sabbaton Elite.png",true,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,true,true,false,true
Tower Guard,"Tower Guard",2,"Follower","+0",1,1,5,0,"Short range.
Guard.","This character can't flank or reinforce.
This character can intercept even when attacked.","","F:\GitLab\dreamkeepers-psd\Images\Lilith\Tower Guard.png",true,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,true,true,false,true
Unstable Lifeflow,"Unstable Lifeflow",3,"Event - Leader","+0",0,0,0,0,"Lilith swaps life with a nearby hero.","Both heroes gain or lose life equal to the difference in their life totals.","","F:\GitLab\dreamkeepers-psd\Images\Lilith\Unstable Lifeflow.png",false,true,false,false,true,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false,false,fals
Decaying Ground,"Decaying Ground",2,"Event - Continuous Leader","+0",0,0,0,0,"Start- Deal 1 to all nearby, non-Ravat characters.
Nearby characters gain short range.","","","F:\GitLab\dreamkeepers-psd\Images\Ravat\Decaying Ground.png",true,false,false,false,true,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true
Finish the Job,"Finish the Job",1,"Action - Leader","+0",0,0,0,0,"Discard a damaged, non-leader character from play.","A damaged character is one that has been dealt damage this turn.","","F:\GitLab\dreamkeepers-psd\Images\Ravat\Finish the Job.png",true,false,false,true,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true
Gruesome Display,"Gruesome Display",2,"Event - Leader","+0",0,0,0,0,"Discard one of your heroes from a lane, if you do, take an extra turn after this one.","","","F:\GitLab\dreamkeepers-psd\Images\Ravat\Gruesome Display.png",false,true,false,false,true,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false
Hunt,"Hunt",2,"Event - Leader","+0",0,0,0,0,"Choose a character.
When Ravat damages that character this turn, he gains +1 speed and +1 damage this turn.","","","F:\GitLab\dreamkeepers-psd\Images\Ravat\Hunt.png",false,false,true,false,true,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true
Lacerate,"Lacerate",2,"Event","+0",0,0,0,0,"Deal 4.","","","F:\GitLab\dreamkeepers-psd\Images\Ravat\Lacerate.png",true,false,false,false,true,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true
Lay Waste,"Lay Waste",5,"Event - Continuous","+0",0,0,0,0,"Start- Discard all nearby non-Ravat cards.
Nothing can enter this lane.","Non-Ravat means all cards except the Ravat leader card.","","F:\GitLab\dreamkeepers-psd\Images\Ravat\Lay Waste.png",false,true,false,false,true,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,false
Mokoi,"Mokoi",3,"Follower","+0",1,4,5,0,"Short range.","","","F:\GitLab\dreamkeepers-psd\Images\Ravat\Mokoi.png",false,false,true,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false,true,true,false,true
No Escape,"No Escape",2,"Action - Leader","+0",0,0,0,0,"A nearby character gets (-1) this turn.
If it's your turn, move Ravat.","","","F:\GitLab\dreamkeepers-psd\Images\Ravat\No Escape.png",true,false,false,true,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,true
Terrify,"Terrify",2,"Action - Leader","+0",0,0,0,0,"Nearby characters get -2 speed this turn.","","","F:\GitLab\dreamkeepers-psd\Images\Ravat\Terrify.png",false,false,true,true,false,false,false,false,false,false,false,true,false,false,false,false,false,false,false,false,false,tru
Big Ninja,"Big Ninja",3,"Follower","+0",1,3,3,0,"Ambush.
Stealth.","This character can be played at any time, and can only be engaged by nearby characters. ","","F:\GitLab\dreamkeepers-psd\Images\Scinter\Big Ninja.png",false,false,true,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,true,true,false,true
Smokescreen,"Smokescreen",3,"Event","+0",0,0,0,0,"You decide how characters intercept this turn.","You may choose to have all or none of your opponent's characters intercept as you choose.","","F:\GitLab\dreamkeepers-psd\Images\Scinter\Smokescreen.png",false,true,false,false,true,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false
Nainso,"Nainso",1,"Follower","+0",1,2,2,0,"Stealth","This character can only be engaged by nearby characters.","","F:\GitLab\dreamkeepers-psd\Images\Scinter\Nainso.png",true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,true,true,false,true
Indigo,"Indigo",1,"Follower","+0",2,2,3,0,"Short range.","This character can't attack or flank.
(+1) represents +1 speed.","","F:\GitLab\dreamkeepers-psd\Images\Scinter\Indigo.png",true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,false,false,true,true,false,true
Rube Goldberg Trap,"Rube Goldberg Trap",2,"Action - Leader","+0",0,0,0,0,"Reveal the top 4 cards of your deck, you may play any traps from among them without paying their costs.
Shuffle your deck.
Trap- Reveal the top 8 cards instead.","You do not need to pay any costs for free cards.","","F:\GitLab\dreamkeepers-psd\Images\Scinter\Rube Goldberg Trap.png",false,false,true,true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,true
Smoke Trap,"Smoke Trap",1,"Action","+0",0,0,0,0,"A character gets (-2) this turn.
Trap- Nearby characters also get (-2) this turn.","If you play this on a character that just entered a lane, the Trap ability triggers.
Characters with (0) or less can't attack, intercept, or redeploy.","","F:\GitLab\dreamkeepers-psd\Images\Scinter\Smoke Trap.png",false,false,true,true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false
Telewarp Trap,"Telewarp Trap",1,"Action","+0",0,0,0,0,"A character gets +2/+2 this turn.
Trap- That character also gets (+1) this turn.","If you play this on a character that just entered a lane, the Trap ability triggers.","","F:\GitLab\dreamkeepers-psd\Images\Scinter\Telewarp Trap.png",false,false,true,true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false
Tripwire Trap,"Tripwire Trap",1,"Action","+0",0,0,0,0,"Deal 2.
Trap- Deal 4 instead.","If you play this on a character that just entered a lane, the Trap ability triggers.","","F:\GitLab\dreamkeepers-psd\Images\Scinter\Tripwire Trap.png",true,false,false,true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,false
Warp Trap,"Warp Trap",2,"Action","+0",0,0,0,0,"Return a follower to it's owner's hand.
Trap- Move a Troika character.","If you play this on a character that just entered a lane, the Trap ability triggers.","","F:\GitLab\dreamkeepers-psd\Images\Scinter\Warp Trap.png",false,false,true,true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,fals
Dust Hulk,"Dust Hulk",4,"Follower - Sandman","+0",1,3,2,0,"Deploy- You may Scrap X cards to disacard a follower with cost X or less from a lane.
Stitch 4.","You may pay 4 to stitch this card from discard onto a Sandman in a lane.that sandman gains this character's damage and toughness (+3/+2).","","F:\GitLab\dreamkeepers-psd\Images\Scuttler\Dust Hulk.png",false,false,true,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,true,true,false,true
Dust Lacky,"Dust Lacky",2,"Follower - Sandman","+0",1,2,2,0,"When another sandman is discarded from a lane, Scuttler gains 1 resolve.
Stitch 4.","You may pay 4 to stitch this card from discard onto a Sandman in a lane.that sandman gains this character's damage and toughness (+2/+2).","","F:\GitLab\dreamkeepers-psd\Images\Scuttler\Dust Lacky.png",true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,true,true,false,true
Expendable Flunky,"Expendable Flunky",1,"Follower - Sandman","+0",1,1,1,0,"Deploy- Replace 2.
Stitch 2.","You may pay 2 to stitch this card from discard onto a Sandman in a lane.that sandman gains this character's damage and toughness (+1/+1).","","F:\GitLab\dreamkeepers-psd\Images\Scuttler\Expendable Flunky.png",true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,true,true,false,true
Hefty Poppet,"Hefty Poppet",3,"Follower - Sandman","+0",1,2,2,0,"Stitch 2.","You may pay 2 to stitch this card from discard onto a Sandman in a lane.that sandman gains this character's damage and toughness (+2/+2).","","F:\GitLab\dreamkeepers-psd\Images\Scuttler\Hefty Poppet.png",false,false,true,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,true,true,false,true
Ragpicker Scout,"Ragpicker Scout",1,"Follower - Sandman","+0",1,0,1,0,"Deploy- Draw 1, then Replace 2.
Stitch 1.","You may pay 1 to stitch this card from discard onto a Sandman in a lane.that sandman gains this character's damage and toughness (+0/+1).","","F:\GitLab\dreamkeepers-psd\Images\Scuttler\Ragpicker Scout.png",true,false,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,true,true,false,true
Ragreaper,"Ragreaper",3,"Follower - Sandman","+0",1,4,2,0,"When this character enters a lane, restore a Sandman to full speed.
Stitch 6.","You may pay 6 to stitch this card from discard onto a Sandman in a lane.that sandman gains this character's damage and toughness (+4/+2).","","F:\GitLab\dreamkeepers-psd\Images\Scuttler\Ragreaper.png",false,true,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,true,true,false,false
Scuttler's Favorite,"Scuttler's Favorite",4,"Follower - Sandman","+0",1,0,1,0,"Deploy- Stitch all sandmen onto this character.
Stitch 1.","You may pay 1 to stitch this card from discard onto a Sandman in a lane.that sandman gains this character's damage and toughness (+0/+1).","","F:\GitLab\dreamkeepers-psd\Images\Scuttler\Scuttler's Favorite.png",false,true,false,false,false,false,false,false,false,false,false,false,true,false,false,false,false,false,true,true,false,false

15
ps.go
View File

@@ -20,30 +20,33 @@ const (
Opts = "/nologo" Opts = "/nologo"
) )
// var PKGPATH = path.Join(os.Getenv("GOPATH"), "src", "github.com", "sbrow", "ps") var pkgpath string
var PKGPATH string
func init() { func init() {
_, file, _, _ := runtime.Caller(0) _, file, _, _ := runtime.Caller(0)
PKGPATH = path.Dir(file) pkgpath = path.Dir(file)
} }
// Open photoshop.
func Start() error { func Start() error {
_, err := run("start") _, err := run("start")
return err return err
} }
// Open a file.
func Open(path string) ([]byte, error) { func Open(path string) ([]byte, error) {
return run("open", path) return run("open", path)
} }
// Close the active document.
func Close() error { func Close() error {
_, err := run("close") _, err := run("close")
return err return err
} }
func Quit() ([]byte, error) { // Quit photoshop with save status.
return run("quit") func Quit(save int) ([]byte, error) {
return run("quit", string(save))
} }
func Js(args ...string) ([]byte, error) { func Js(args ...string) ([]byte, error) {
@@ -69,7 +72,7 @@ func run(name string, args ...string) ([]byte, error) {
if !strings.HasSuffix(name, ext) { if !strings.HasSuffix(name, ext) {
name += ext name += ext
} }
args = append([]string{Opts, path.Join(PKGPATH, "scripts", name)}, args...) args = append([]string{Opts, path.Join(pkgpath, "scripts", name)}, args...)
cmd := exec.Command(Cmd, args...) cmd := exec.Command(Cmd, args...)
cmd.Stdout = &out cmd.Stdout = &out
cmd.Stderr = &stderr cmd.Stderr = &stderr

View File

@@ -3,13 +3,14 @@ package ps
import ( import (
"fmt" "fmt"
_ "io/ioutil" _ "io/ioutil"
_ "path" "os"
"path"
_ "strings" _ "strings"
"testing" "testing"
) )
func TestPkgPath(t *testing.T) { func TestPkgPath(t *testing.T) {
fmt.Println(PKGPATH) fmt.Println(pkgpath)
} }
// TODO: Comparison borked // TODO: Comparison borked
@@ -22,6 +23,8 @@ func TestRun(t *testing.T) {
if string(msg) == string(out) { if string(msg) == string(out) {
fail := fmt.Sprintf("run(test)\ngot:\t\"%s\"\nwant:\t\"%s\"\n", msg, out) fail := fmt.Sprintf("run(test)\ngot:\t\"%s\"\nwant:\t\"%s\"\n", msg, out)
t.Fatal(fail) t.Fatal(fail)
} else {
os.Remove(path.Join(pkgpath, "scripts", "test.txt"))
} }
} }
@@ -36,7 +39,7 @@ func TestQuit(t *testing.T) {
if testing.Short() { if testing.Short() {
t.Skip("Skipping \"TestQuit\"") t.Skip("Skipping \"TestQuit\"")
} }
Quit() Quit(2)
} }
func TestWait(t *testing.T) { func TestWait(t *testing.T) {

View File

@@ -2,7 +2,7 @@
Set appRef = CreateObject("Photoshop.Application") Set appRef = CreateObject("Photoshop.Application")
Do While appRef.Documents.Count > 0 Do While appRef.Documents.Count > 0
appRef.ActiveDocument.Close(2) appRef.ActiveDocument.Close(wScript.Arguments(0))
Loop Loop
appRef.Quit() appRef.Quit()

View File

@@ -1 +0,0 @@
Testing...