Skip to content
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.

Commit

Permalink
freezing state
Browse files Browse the repository at this point in the history
  • Loading branch information
magicink committed Oct 8, 2014
1 parent 0768406 commit 309eaf5
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/coffee/sass-colour-lover.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ class module.exports.Palette

@writeFile : ->

palette = module.exports.Palette

output = "// Palette: #{@title}\r\n"
output += "// Author: #{@author}\r\n"
output += "// #{@url}\r\n"
Expand All @@ -230,25 +232,25 @@ class module.exports.Palette
output += value
output += ';\r\n'

if module.exports.Palette.getAppend() is false
if palette.getAppend() is false

fs.writeFile @file, output, (error)->

if error?
console.log error

module.exports.Palette.setAppend true
palette.setAppend true

if module.exports.Palette.palettes?
if palette.palettes?

if module.exports.Palette.palettes.length > 0 and
module.exports.Palette.getMulti() is true
if palette.palettes.length > 0 and
palette.getMulti() is true

nextPalette = module.exports.Palette.palettes.pop()
nextPalette = palette.palettes.pop()

module.exports.Palette.requestPalette nextPalette
palette.requestPalette nextPalette

else if module.exports.Palette.getAppend() is true
else if palette.getAppend() is true

output = "\r\n" + output

Expand All @@ -257,11 +259,11 @@ class module.exports.Palette
if error?
console.log error

if module.exports.Palette.palettes.length > 0
if palette.palettes.length > 0

nextPalette = module.exports.Palette.palettes.pop()
nextPalette = palette.palettes.pop()

module.exports.Palette.requestPalette nextPalette
palette.requestPalette nextPalette

###
# This method decides how command line arguments are handled
Expand Down Expand Up @@ -380,6 +382,7 @@ isURL = false

idFlag = /^(--ids=)(.*)/
urlFlag = /^(http:\/\/|)(www\.|)colourlovers\.com\/palette\/(\d+)\//
appendFlag = /^--append$/

if parameters.length > 0

Expand Down

0 comments on commit 309eaf5

Please sign in to comment.